[wp-trac] [WordPress Trac] #18706: Erroneous admin menu highlighting for non-public post type taxonomies

WordPress Trac wp-trac at lists.automattic.com
Mon Sep 19 16:25:44 UTC 2011


#18706: Erroneous admin menu highlighting for non-public post type taxonomies
--------------------------+-----------------------------
 Reporter:  johnbillion   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Post Types    |    Version:  3.3
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 To reproduce:

 1. Register a post type with 'public' set to false and 'show_ui' set to
 true.
 2. Register a taxonomy for this post type.
 3. Visit the taxonomy management screen for your taxonomy. The 'Posts' top
 level menu will be highlighted instead of your custom post type.

 Changing the 'public' parameter of the post type to true fixes the
 problem, but obviously does not have the desired outcome.

 Sample code:
 {{{
 function add_my_post_type() {

         $post_type_args = array(
                 'public'  => false,
                 'show_ui' => true,
                 'labels'  => array(
                         'name'          => 'Foos',
                         'singular_name' => 'Foo'
                 )
         );
         register_post_type( 'foo', $post_type_args );

         $taxo_args = array(
                 'public'  => false,
                 'show_ui' => true,
                 'labels'  => array(
                         'name'          => 'Foo Types',
                         'singular_name' => 'Foo Type'
                 )
         );
         register_taxonomy( 'foo_type', 'foo', $taxo_args );

 }

 add_action( 'init', 'add_my_post_type' );
 }}}
 I had a dig but I can't find where the problem is occurring.

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


More information about the wp-trac mailing list