Ignore index.php in plugins dir when creating menus. fixes #6478

git-svn-id: https://develop.svn.wordpress.org/trunk@10510 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2009-02-05 21:02:46 +00:00
parent 88b2fb0884
commit b94b8e99a5
1 changed files with 1 additions and 1 deletions

View File

@ -115,7 +115,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]}") && ('index.php' != $sub_item[2]) ) || ! empty($menu_hook) ) {
// If admin.php is the current page or if the parent exists as a file in the plugins or admin dir // If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
$parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]); $parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/{$item[2]}") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($item[2]);
if ( $parent_exists ) if ( $parent_exists )