mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-24 01:57:53 +01:00
Fix menu_page_url() for submenu pages attached to custom menu pages. props duck_, see #14159.
git-svn-id: http://svn.automattic.com/wordpress/trunk@16829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
7af05b685c
commit
adbcaa8019
@ -1280,8 +1280,9 @@ function menu_page_url($menu_slug, $echo = true) {
|
||||
global $_parent_pages;
|
||||
|
||||
if ( isset( $_parent_pages[$menu_slug] ) ) {
|
||||
if ( $_parent_pages[$menu_slug] ) {
|
||||
$url = admin_url( add_query_arg( 'page', $menu_slug, $_parent_pages[$menu_slug] ) );
|
||||
$parent_slug = $_parent_pages[$menu_slug];
|
||||
if ( $parent_slug && ! isset( $_parent_pages[$parent_slug] ) ) {
|
||||
$url = admin_url( add_query_arg( 'page', $menu_slug, $parent_slug ) );
|
||||
} else {
|
||||
$url = admin_url( 'admin.php?page=' . $menu_slug );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user