I just created a custom post type and a custom taxonomy:
// === CUSTOM TAXONOMIES === //
add_action('init', 'my_custom_taxonomies', 0);
function my_custom_taxonomies() {
register_taxonomy(
'location', // internal name = machine-readable taxonomy name
'static_content', // object type = post, page, link, or custom post-type
array(
'hierarchical' => true,
'labels' => array(
'name' => __( 'Location' ),
'singular_name' => __( 'Location' ),
'add_new_item' => 'Add New Location',
'edit_item' => 'Edit Location',
'new_item' => 'New Location',
'search_items' => 'Search Location',
'not_found' => 'No Location found',
'not_found_in_trash' => 'No Location found in trash',
),
'query_var' => true, // enable taxonomy-specific querying
'rewrite' => array( 'slug' => 'location' ), // pretty permalinks for your taxonomy?
)
);
wp_insert_term('Footer', 'location');
wp_insert_term('Header', 'location');
}
// === CUSTOM POST TYPES === //
add_action( 'init', 'create_my_post_types' );
function create_my_post_types() {
register_post_type( 'static_content',
array(
'labels' => array(
'name' => __( 'Static Content' ),
'singular_name' => __( 'Static Content' ),
'add_new_item' => 'Add New Static Content',
'edit_item' => 'Edit Static Content',
'new_item' => 'New Static Content',
'search_items' => 'Search Static Content',
'not_found' => 'No Static Content found',
'not_found_in_trash' => 'No Static Content found in trash',
),
'_builtin' => false,
'public' => true,
'hierarchical' => false,
'taxonomies' => array( 'location'),
'supports' => array(
'title',
'editor',
'excerpt'
),
'rewrite' => array( 'slug' => 'static_content', 'with_front' => false )
)
);
}
But when I enter the edit page of my custom post type, on the sidebar it says "All Categories." It should say "All Locations."
How do I change that label?