[wp-trac] [WordPress Trac] #15837: Custom Taxonomy: Admin Menu Not Selecting Current Item

WordPress Trac wp-trac at lists.automattic.com
Wed Dec 15 21:57:25 UTC 2010


#15837: Custom Taxonomy: Admin Menu Not Selecting Current Item
--------------------------+-----------------------------
 Reporter:  sterlo        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 Story: Developing a plugin that adds a Custom Post Type and then a
 Taxonomy.

 Problem: Adding the Taxonomy and displaying the Menu Item on the Admin
 section, when selecting the menu item - there seems to be a difference in
 functionality depending on what tag the Taxonomy hooks onto.

 For example code:
 {{{
       register_taxonomy(
         'mytaxonomy',
         'myposttype',
         array(
           'labels' => array(
             'name' => 'Manage XXX',
             'add_new_item' => 'Add New XXX',
             'new_item_name' => 'New XXX Name',
             'add_new' => 'Add New XXX',
             'singular_name' => 'XXX'
           ),
           'public' => false,
           'publicly_queryable' => true,
           'show_ui' => true,
           'hierarchical' => true,
           'rewrite' => array(
             'slug' => 'XXX',
             'with_front' => false
           ),
           'query_var' => 'XXX'
         )
       );
 }}}

 The above code adds the Menu Item for the Taxonomy to the new Custom Post
 Type menu I created.

 When I select the new Taxonomy...it "open" or "behaves" as though it
 expects to see it under the "post" tag.

 It does not select the Taxonomy Menu Item as "current".

 Expected result: Select Taxonomy Menu Item -> Menu Item obtains CSS class
 of "current".

 Actual result: Select Taxonomy Menu Item -> Menu Item doesn't obtain a CSS
 class and IF the Posts menu was "collapsed" it expands.

 Now - conversely if I add the Taxonomy Menu Item to the tag "post" - it
 DOES add the CSS class.

 This seems to be inconsistent functionality and I believe that it's not
 there's something surrounding it that has to be malfunctioning.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15837>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list