[wp-trac] [WordPress Trac] #24376: Sharing Custom Taxonomies with built-in Post Types
WordPress Trac
noreply at wordpress.org
Mon May 20 22:57:58 UTC 2013
#24376: Sharing Custom Taxonomies with built-in Post Types
--------------------------+-----------------------------
Reporter: ZaneMatthew | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.5.1
Severity: normal | Keywords:
--------------------------+-----------------------------
If you register a custom taxonomy for built-in post types the admin pages
containing the table and count for the custom taxonomy have the wrong
count for each term.
Use case, I've register a custom taxonomy and assigned to the Post and
Page post types like the following:
{{{
register_taxonomy(
'cat',
array('post','page'),
array(
'labels' => array(
'name' => _x( 'Cat', 'taxonomy general name' ),
'singular_name' => _x( 'Cat', 'taxonomy singular name'
),
'search_items' => __( 'Search Cats', 'some_plugin' ),
'all_items' => __( 'All Cats', 'some_plugin' ),
'parent_item' => __( 'Parent Cat', 'some_plugin' ),
'parent_item_colon' => __( 'Parent Cat:', 'some_plugin' ),
'edit_item' => __( 'Edit Cat', 'some_plugin' ),
'update_item' => __( 'Update Cat', 'some_plugin' ),
'add_new_item' => __( 'Add New Cat', 'some_plugin' ),
'new_item_name' => __( 'New Cat Name', 'some_plugin' ),
'menu_name' => __( 'Cat', 'some_plugin' )
),
'hierarchical' => true,
'show_admin_column' => true,
'show_ui' => true
)
);
}}}
If you add a post and create different cats, you'll see the same count
shows in both admin taxonomy UIs
/wp-admin/edit-tags.php?taxonomy=cat
/wp-admin/edit-tags.php?taxonomy=cat&post_type=page
--
Ticket URL: <http://core.trac.wordpress.org/ticket/24376>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list