WordPress.org

Make WordPress Core

Changeset 16829


Ignore:
Timestamp:
12/09/10 04:02:37 (4 years ago)
Author:
nacin
Message:

Fix menu_page_url() for submenu pages attached to custom menu pages. props duck_, see #14159.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r16758 r16829  
    10091009/** 
    10101010 * Add sub menu page to the tools main menu. 
    1011 * 
     1011 * 
    10121012 * This function takes a capability which will be used to determine whether 
    10131013 * or not a page is included in the menu. 
     
    10281028/** 
    10291029 * Add sub menu page to the options main menu. 
    1030 * 
     1030 * 
    10311031 * This function takes a capability which will be used to determine whether 
    10321032 * or not a page is included in the menu. 
     
    10471047/** 
    10481048 * Add sub menu page to the themes main menu. 
    1049 * 
     1049 * 
    10501050 * This function takes a capability which will be used to determine whether 
    10511051 * or not a page is included in the menu. 
     
    10661066/** 
    10671067 * Add sub menu page to the plugins main menu. 
    1068 * 
     1068 * 
    10691069 * This function takes a capability which will be used to determine whether 
    10701070 * or not a page is included in the menu. 
     
    10851085/** 
    10861086 * Add sub menu page to the Users/Profile main menu. 
    1087 * 
     1087 * 
    10881088 * This function takes a capability which will be used to determine whether 
    10891089 * or not a page is included in the menu. 
     
    11071107/** 
    11081108 * Add sub menu page to the Dashboard main menu. 
    1109 * 
     1109 * 
    11101110 * This function takes a capability which will be used to determine whether 
    11111111 * or not a page is included in the menu. 
     
    11261126/** 
    11271127 * Add sub menu page to the posts main menu. 
    1128 * 
     1128 * 
    11291129 * This function takes a capability which will be used to determine whether 
    11301130 * or not a page is included in the menu. 
     
    11451145/** 
    11461146 * Add sub menu page to the media main menu. 
    1147 * 
     1147 * 
    11481148 * This function takes a capability which will be used to determine whether 
    11491149 * or not a page is included in the menu. 
     
    11641164/** 
    11651165 * Add sub menu page to the links main menu. 
    1166 * 
     1166 * 
    11671167 * This function takes a capability which will be used to determine whether 
    11681168 * or not a page is included in the menu. 
     
    11831183/** 
    11841184 * Add sub menu page to the pages main menu. 
    1185 * 
     1185 * 
    11861186 * This function takes a capability which will be used to determine whether 
    11871187 * or not a page is included in the menu. 
     
    12021202/** 
    12031203 * Add sub menu page to the comments main menu. 
    1204 * 
     1204 * 
    12051205 * This function takes a capability which will be used to determine whether 
    12061206 * or not a page is included in the menu. 
     
    12811281 
    12821282    if ( isset( $_parent_pages[$menu_slug] ) ) { 
    1283         if ( $_parent_pages[$menu_slug] ) { 
    1284             $url = admin_url( add_query_arg( 'page', $menu_slug, $_parent_pages[$menu_slug] ) ); 
     1283        $parent_slug = $_parent_pages[$menu_slug]; 
     1284        if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) { 
     1285            $url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) ); 
    12851286        } else { 
    1286             $url = admin_url('admin.php?page=' . $menu_slug); 
     1287            $url = admin_url( 'admin.php?page=' . $menu_slug ); 
    12871288        } 
    12881289    } else { 
Note: See TracChangeset for help on using the changeset viewer.