[wp-trac] [WordPress Trac] #17528: Comments menu has sub-menu despite only having one item

WordPress Trac wp-trac at lists.automattic.com
Wed Jun 22 13:17:51 UTC 2011


#17528: Comments menu has sub-menu despite only having one item
-----------------------------------+-----------------------
 Reporter:  kawauso                |       Owner:  ryan
     Type:  defect (bug)           |      Status:  reopened
 Priority:  normal                 |   Milestone:  3.2
Component:  Administration         |     Version:  3.2
 Severity:  normal                 |  Resolution:
 Keywords:  has-patch needs-patch  |
-----------------------------------+-----------------------
Changes (by kevinB):

 * cc: kevin@… (added)
 * keywords:  has-patch close => has-patch needs-patch
 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 The current patch (as included in 3.2 RC1) breaks permissions handling
 under some configurations.

 A plugin or theme may remove the post-new.php submenu if user capabilities
 are filtered to allow editing but not creation.  If so,
 user_can_access_admin_page() now always returns false for edit.php even if
 a current_user_can( 'edit_posts' ) cap check would pass.

 After the remaining "All Posts" item is removed from $submenu,
 get_admin_page_parent() no longer finds a match for $pagenow and
 $typenow... and returns nullstring.

 In my use case, this can be remedied by uncommenting this block in
 get_admin_page_parent() :

 {{{
 if ( !empty ( $parent_file ) ) {
    if ( isset( $_wp_real_parent_file[$parent_file] ) )
         $parent_file = $_wp_real_parent_file[$parent_file];

    return $parent_file;
 }
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17528#comment:8>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list