[wp-trac] [WordPress Trac] #13560: Add custom taxonomy to Pages admin menu

WordPress Trac wp-trac at lists.automattic.com
Wed May 26 18:46:49 UTC 2010


#13560: Add custom taxonomy to Pages admin menu
--------------------------+-------------------------------------------------
 Reporter:  markauk       |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  normal        |   Milestone:  Unassigned
Component:  Taxonomy      |     Version:  3.0       
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 When adding a custom taxonomy to posts, a submenu is added beneath 'Posts'
 to allow editing of the taxonomy. However, a menu is not added if the
 taxonomy is attached to Pages, even though the taxonomy works fine when
 creating/editing posts.

 Adding the following code to wp-admin/menu.php fixes this.

 immediately after
 {{{
 $submenu['edit.php?post_type=page'][10] = array( _x('Add New', 'page'),
 'edit_pages', 'post-new.php?post_type=page' );
 }}}

 (line 110 in 3.0b2)

 add
 {{{
         $i = 15;
         foreach ( $wp_taxonomies as $tax ) {
                 if ( ! $tax->show_ui || ! in_array('page', (array)
 $tax->object_type, true) )
                         continue;
                 $submenu['edit.php?post_type=page'][$i++] = array(
 esc_attr($tax->label), $tax->manage_cap, 'edit-tags.php?taxonomy=' .
 $tax->name );
         }
         unset($tax);
 }}}
 (basically a duplicate of the code earlier in menu.php which adds the edit
 taxonomy submenu for pages).

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


More information about the wp-trac mailing list