Menu fixes. see #7552
git-svn-id: https://develop.svn.wordpress.org/trunk@8735 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0920c3eb27
commit
4533de26cf
@ -488,7 +488,7 @@ function get_admin_page_parent( $parent = '' ) {
|
|||||||
global $_wp_menu_nopriv;
|
global $_wp_menu_nopriv;
|
||||||
global $_wp_submenu_nopriv;
|
global $_wp_submenu_nopriv;
|
||||||
|
|
||||||
if ( !empty ( $parent ) ) {
|
if ( !empty ( $parent ) && 'admin.php' != $parent ) {
|
||||||
if ( isset( $_wp_real_parent_file[$parent] ) )
|
if ( isset( $_wp_real_parent_file[$parent] ) )
|
||||||
$parent = $_wp_real_parent_file[$parent];
|
$parent = $_wp_real_parent_file[$parent];
|
||||||
return $parent;
|
return $parent;
|
||||||
|
@ -87,7 +87,7 @@ function _wp_menu_output( &$menu, &$submenu, $submenu_as_parent = true ) {
|
|||||||
$menu_hook = get_plugin_page_hook($sub_item[2], $item[2]);
|
$menu_hook = get_plugin_page_hook($sub_item[2], $item[2]);
|
||||||
|
|
||||||
if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) {
|
if ( file_exists(WP_PLUGIN_DIR . "/{$sub_item[2]}") || ! empty($menu_hook) ) {
|
||||||
if ( 'admin.php' == $pagenow )
|
if ( 'admin.php' == $pagenow || !file_exists(WP_PLUGIN_DIR . "/$parent_file") )
|
||||||
echo "\n\t\t<li$class><a href='admin.php?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
echo "\n\t\t<li$class><a href='admin.php?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
||||||
else
|
else
|
||||||
echo "\n\t\t<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
echo "\n\t\t<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class>{$sub_item[0]}</a></li>";
|
||||||
|
Loading…
Reference in New Issue
Block a user