Created
May 9, 2013 20:07
-
-
Save JiveDig/5550180 to your computer and use it in GitHub Desktop.
Register new taxonomy, like Categories
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
// ------------------------------ Video Categories | |
if ( ! function_exists('jivedig_video_category_taxonomy') ) { | |
// Register Custom Taxonomy | |
function jivedig_video_category_taxonomy() { | |
$labels = array( | |
'name' => 'Video Categories', | |
'singular_name' => 'Video Category', | |
'menu_name' => 'Video Categories', | |
'all_items' => 'All Video Categories', | |
'parent_item' => 'Parent Video Category', | |
'parent_item_colon' => 'Parent Video Category:', | |
'new_item_name' => 'New Video Category', | |
'add_new_item' => 'Add New Video Category', | |
'edit_item' => 'Edit Video Category', | |
'update_item' => 'Update Video Category', | |
'separate_items_with_commas' => 'Separate video categories with commas', | |
'search_items' => 'Search video categories', | |
'add_or_remove_items' => 'Add or remove video categories', | |
'choose_from_most_used' => 'Choose from the most used video categories', | |
); | |
$rewrite = array( | |
'slug' => 'video-categories', | |
'with_front' => true, | |
'hierarchical' => true, | |
); | |
$args = array( | |
'labels' => $labels, | |
'hierarchical' => true, | |
'public' => true, | |
'show_ui' => true, | |
'show_admin_column' => true, | |
'show_in_nav_menus' => true, | |
'show_tagcloud' => false, | |
'query_var' => 'video_cat', | |
'rewrite' => $rewrite, | |
); | |
register_taxonomy( 'video_cat', 'videos', $args ); | |
} | |
// Hook into the 'init' action | |
add_action( 'init', 'jivedig_video_category_taxonomy', 0 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment