WordPress.org

Make WordPress Core

Ticket #8111: menu9710.diff

File menu9710.diff, 955 bytes (added by mrmist, 6 years ago)

menu.php alteration - fix initial view to user if they edit other posts.

  • menu.

    old new  
    3232$menu[5] = array( __('Posts'), 'edit_posts', 'post-new.php', '', 'wp-menu-open menu-top', 'menu-posts', 'div' ); 
    3333        $submenu['post-new.php'][5]  = array( _c('Add New|post'), 'edit_posts', 'post-new.php' ); 
    3434        //$submenu['post-new.php'][10]  = array( __('Drafts'), 'edit_posts', 'edit-post-drafts.php' ); 
    35         $submenu['post-new.php'][15]  = array( __('Edit'), 'edit_posts', 'edit.php' ); 
     35        if ( current_user_can( 'edit_others_posts' ) ) {         
     36                $submenu['post-new.php'][15]  = array( __('Edit'), 'edit_posts', 'edit.php' ); 
     37        } else { 
     38                $submenu['post-new.php'][15]  = array( __('Edit'), 'edit_posts', 'edit.php?author='.$current_user->ID ); 
     39        } 
    3640        $submenu['post-new.php'][20] = array( __('Tags'), 'manage_categories', 'edit-tags.php' ); 
    3741        $submenu['post-new.php'][25] = array( __('Categories'), 'manage_categories', 'categories.php' ); 
    3842