Created
February 24, 2012 23:05
-
-
Save JLeuze/1904421 to your computer and use it in GitHub Desktop.
Functionality plugin for MSP WordPress Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: MSP WP Demo Functionality | |
Plugin URI: https://gist.github.com/1904421 | |
Description: Functionality plugin for MSP WordPress Demo | |
Version: 1.0 | |
Author: Josh Leuze | |
Author URI: http://www.jleuze.com/ | |
License: GPL2 | |
*/ | |
/* Copyright 2012 Josh Leuze (email : mail@jleuze.com) | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License, version 2, as | |
published by the Free Software Foundation. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
GNU General Public License for more details. | |
You should have received a copy of the GNU General Public License | |
along with this program; if not, write to the Free Software | |
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
*/ | |
// Adds custom taxonomy for People | |
add_action( 'init', 'mspdemo_register_taxonomy' ); | |
function mspdemo_register_taxonomy() { | |
$mspdemo_tax_labels = array( | |
'name' => __( 'People', 'msp-wp-demo-functionality' ), | |
'singular_name' => __( 'Person', 'msp-wp-demo-functionality' ), | |
'search_items' => __( 'Search People', 'msp-wp-demo-functionality' ), | |
'popular_items' => __( 'Popular People', 'msp-wp-demo-functionality' ), | |
'all_items' => __( 'All People', 'msp-wp-demo-functionality' ), | |
'parent_item' => __( 'Parent Person', 'msp-wp-demo-functionality' ), | |
'parent_item_colon' => __( 'Parent Person:', 'msp-wp-demo-functionality' ), | |
'edit_item' => __( 'Edit Person', 'msp-wp-demo-functionality' ), | |
'update_item' => __( 'Update Person', 'msp-wp-demo-functionality' ), | |
'add_new_item' => __( 'Add New Person', 'msp-wp-demo-functionality' ), | |
'new_item_name' => __( 'New Person Name', 'msp-wp-demo-functionality' ), | |
'menu_name' => __( 'People', 'msp-wp-demo-functionality' ) | |
); | |
$mspdemo_tax_capabilities = array( | |
'manage_terms' => 'manage_categories', | |
'edit_terms' => 'manage_categories', | |
'delete_terms' => 'manage_categories', | |
'assign_terms' => 'edit_posts' | |
); | |
$mspdemo_tax_args = array( | |
'labels' => $mspdemo_tax_labels, | |
'public' => true, | |
'show_in_nav_menus' => false, | |
'show_ui' => true, | |
'show_tagcloud' => false, | |
'hierarchical' => true, | |
'rewrite' => array( 'slug' => 'People' ), | |
'capabilities' => $mspdemo_tax_capabilities | |
); | |
register_taxonomy( 'people', 'post', $mspdemo_tax_args ); | |
} | |
// Adds translation support for language files | |
add_action( 'plugins_loaded', 'mspdemo_localization' ); | |
function mspdemo_localization() { | |
load_plugin_textdomain( 'msp-wp-demo-functionality', false, '/msp-wp-demo-functionality/languages/' ); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment