Last active
December 15, 2015 07:49
-
-
Save szbl/5226656 to your computer and use it in GitHub Desktop.
Adding taxonomy column to custom post type listing for my WordCamp San Diego 2013 presentation on Advanced Custom Post Types.
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 | |
add_action( 'init', 'szbl_register_tax' ); | |
function szbl_register_tax() | |
{ | |
register_taxonomy( | |
'szbl-location-category', | |
array( 'szbl-location' ), | |
array( | |
'labels' => array( | |
'name' => __( 'Store Categories' ), | |
'singular_name' => _x( 'Store Category' ), | |
'search_items' => __( 'Search Store Categories' ), | |
'all_items' => __( 'All Store Categories' ), | |
'parent_item' => __( 'Parent Store Category' ), | |
'parent_item_colon' => __( 'Parent Store Category:' ), | |
'edit_item' => __( 'Edit Store Category' ), | |
'update_item' => __( 'Update Store Category' ), | |
'add_new_item' => __( 'Add New Store Category' ), | |
'new_item_name' => __( 'New Store Category Name' ), | |
'menu_name' => __( 'Store Categories' ) | |
), | |
'public' => true, | |
'show_ui' => true, | |
'show_in_nav_menus' => false, | |
'show_tagcloud' => false, | |
// show the admin column | |
'show_admin_column' => true, | |
'hierarchical' => true, | |
'query_var' => true, | |
'rewrite' => array( | |
'slug' => 'location-category', | |
'with_front' => false, | |
'hierarchical' => true | |
) | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment