WordPress.org

Make WordPress Core

Ticket #14159: 14159.diff

File 14159.diff, 3.1 KB (added by duck_, 3 years ago)
  • wp-admin/includes/plugin.php

     
    998998 
    999999/** 
    10001000 * Add sub menu page to the tools main menu. 
    1001 * 
     1001 * 
    10021002 * This function takes a capability which will be used to determine whether 
    10031003 * or not a page is included in the menu. 
    10041004 * 
     
    10171017 
    10181018/** 
    10191019 * Add sub menu page to the options main menu. 
    1020 * 
     1020 * 
    10211021 * This function takes a capability which will be used to determine whether 
    10221022 * or not a page is included in the menu. 
    10231023 * 
     
    10361036 
    10371037/** 
    10381038 * Add sub menu page to the themes main menu. 
    1039 * 
     1039 * 
    10401040 * This function takes a capability which will be used to determine whether 
    10411041 * or not a page is included in the menu. 
    10421042 * 
     
    10551055 
    10561056/** 
    10571057 * Add sub menu page to the plugins main menu. 
    1058 * 
     1058 * 
    10591059 * This function takes a capability which will be used to determine whether 
    10601060 * or not a page is included in the menu. 
    10611061 * 
     
    10741074 
    10751075/** 
    10761076 * Add sub menu page to the Users/Profile main menu. 
    1077 * 
     1077 * 
    10781078 * This function takes a capability which will be used to determine whether 
    10791079 * or not a page is included in the menu. 
    10801080 * 
     
    10961096} 
    10971097/** 
    10981098 * Add sub menu page to the Dashboard main menu. 
    1099 * 
     1099 * 
    11001100 * This function takes a capability which will be used to determine whether 
    11011101 * or not a page is included in the menu. 
    11021102 * 
     
    11151115 
    11161116/** 
    11171117 * Add sub menu page to the posts main menu. 
    1118 * 
     1118 * 
    11191119 * This function takes a capability which will be used to determine whether 
    11201120 * or not a page is included in the menu. 
    11211121 * 
     
    11341134 
    11351135/** 
    11361136 * Add sub menu page to the media main menu. 
    1137 * 
     1137 * 
    11381138 * This function takes a capability which will be used to determine whether 
    11391139 * or not a page is included in the menu. 
    11401140 * 
     
    11531153 
    11541154/** 
    11551155 * Add sub menu page to the links main menu. 
    1156 * 
     1156 * 
    11571157 * This function takes a capability which will be used to determine whether 
    11581158 * or not a page is included in the menu. 
    11591159 * 
     
    11721172 
    11731173/** 
    11741174 * Add sub menu page to the pages main menu. 
    1175 * 
     1175 * 
    11761176 * This function takes a capability which will be used to determine whether 
    11771177 * or not a page is included in the menu. 
    11781178 * 
     
    11911191 
    11921192/** 
    11931193 * Add sub menu page to the comments main menu. 
    1194 * 
     1194 * 
    11951195 * This function takes a capability which will be used to determine whether 
    11961196 * or not a page is included in the menu. 
    11971197 * 
     
    12701270        global $_parent_pages; 
    12711271 
    12721272        if ( isset( $_parent_pages[$menu_slug] ) ) { 
    1273                 if ( $_parent_pages[$menu_slug] ) { 
    1274                         $url = admin_url( add_query_arg( 'page', $menu_slug, $_parent_pages[$menu_slug] ) ); 
     1273                $parent_slug = $_parent_pages[$menu_slug]; 
     1274                if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) { 
     1275                        $url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) ); 
    12751276                } else { 
    1276                         $url = admin_url('admin.php?page=' . $menu_slug); 
     1277                        $url = admin_url( 'admin.php?page=' . $menu_slug ); 
    12771278                } 
    12781279        } else { 
    12791280                $url = ''; 
     
    16841685        wp_nonce_field("$option_group-options"); 
    16851686} 
    16861687 
    1687 ?> 
    1688  No newline at end of file 
     1688?>