Created
February 26, 2013 02:25
-
-
Save blogjunkie/5035286 to your computer and use it in GitHub Desktop.
Register custom taxonomies 1) quote topic and 2) quote author for quote custom post type
This file contains hidden or 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 | |
/** | |
* Taxonomies | |
* | |
* This file registers any custom taxonomies | |
* | |
* @package Core_Functionality | |
* @since 1.0.0 | |
* @link https://github.com/billerickson/Core-Functionality | |
* @author Bill Erickson <[email protected]> | |
* @copyright Copyright (c) 2011, Bill Erickson | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
*/ | |
/** | |
* Create Location Taxonomy | |
* @since 1.0.0 | |
* @link http://codex.wordpress.org/Function_Reference/register_taxonomy | |
*/ | |
add_action( 'init', 'tdl_register_taxonomy_quote_topic' ); | |
add_action( 'init', 'tdl_register_taxonomy_quote_author' ); | |
function tdl_register_taxonomy_quote_topic() { | |
$labels = array( | |
'name' => _x( 'Quote Topic', 'tdl' ), | |
'singular_name' => _x( 'Quote Topic', 'tdl' ), | |
'search_items' => _x( 'Search Quote Topic', 'tdl' ), | |
'popular_items' => _x( 'Popular Quote Topic', 'tdl' ), | |
'all_items' => _x( 'All Quote Topic', 'tdl' ), | |
'parent_item' => _x( 'Parent Quote Topic', 'tdl' ), | |
'parent_item_colon' => _x( 'Parent Quote Topic:', 'tdl' ), | |
'edit_item' => _x( 'Edit Quote Topic', 'tdl' ), | |
'update_item' => _x( 'Update Quote Topic', 'tdl' ), | |
'add_new_item' => _x( 'Add New Quote Topic', 'tdl' ), | |
'new_item_name' => _x( 'New Quote Topic', 'tdl' ), | |
'separate_items_with_commas' => _x( 'Separate quote topic with commas', 'tdl' ), | |
'add_or_remove_items' => _x( 'Add or remove Quote Topic', 'tdl' ), | |
'choose_from_most_used' => _x( 'Choose from most used Quote Topic', 'tdl' ), | |
'menu_name' => _x( 'Quote Topics', 'tdl' ), | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'show_in_nav_menus' => false, | |
'show_ui' => true, | |
'show_tagcloud' => true, | |
'hierarchical' => false, | |
'show_admin_column' => true, | |
'rewrite' => true, | |
'query_var' => true | |
); | |
register_taxonomy( 'quote_topic', array('quote'), $args ); | |
} | |
function tdl_register_taxonomy_quote_author() { | |
$labels = array( | |
'name' => _x( 'Quote Author', 'tdl' ), | |
'singular_name' => _x( 'Quote Author', 'tdl' ), | |
'search_items' => _x( 'Search Quote Authors', 'tdl' ), | |
'popular_items' => _x( 'Popular Quote Authors', 'tdl' ), | |
'all_items' => _x( 'All Quote Authors', 'tdl' ), | |
'parent_item' => _x( 'Parent Quote Author', 'tdl' ), | |
'parent_item_colon' => _x( 'Parent Quote Author:', 'tdl' ), | |
'edit_item' => _x( 'Edit Quote Author', 'tdl' ), | |
'update_item' => _x( 'Update Quote Author', 'tdl' ), | |
'add_new_item' => _x( 'Add New Quote Author', 'tdl' ), | |
'new_item_name' => _x( 'New Quote Author', 'tdl' ), | |
'separate_items_with_commas' => _x( 'Separate quote authors with commas', 'tdl' ), | |
'add_or_remove_items' => _x( 'Add or remove Quote Authors', 'tdl' ), | |
'choose_from_most_used' => _x( 'Choose from most used Quote Authors', 'tdl' ), | |
'menu_name' => _x( 'Quote Authors', 'tdl' ), | |
); | |
$args = array( | |
'labels' => $labels, | |
'public' => true, | |
'show_in_nav_menus' => false, | |
'show_ui' => true, | |
'show_tagcloud' => true, | |
'hierarchical' => false, | |
'show_admin_column' => true, | |
'rewrite' => true, | |
'query_var' => true | |
); | |
register_taxonomy( 'quote_author', array('quote'), $args ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment