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:
nacin 2010-12-09 04:02:37 +00:00
parent 7af05b685c
commit adbcaa8019

View File

@ -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 );
}