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