web/wp-admin/menu-header.php
branchwordpress
changeset 132 4d4862461b8d
parent 109 03b0d1493584
equal deleted inserted replaced
131:a4642baaf829 132:4d4862461b8d
   129 				if ( false !== $pos = strpos($sub_file, '?') )
   129 				if ( false !== $pos = strpos($sub_file, '?') )
   130 					$sub_file = substr($sub_file, 0, $pos);
   130 					$sub_file = substr($sub_file, 0, $pos);
   131 
   131 
   132 				if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/$sub_file") ) || ! empty($menu_hook) ) {
   132 				if ( ( ('index.php' != $sub_item[2]) && file_exists(WP_PLUGIN_DIR . "/$sub_file") ) || ! empty($menu_hook) ) {
   133 					// If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
   133 					// If admin.php is the current page or if the parent exists as a file in the plugins or admin dir
   134 					
   134 
   135 					$parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file);
   135 					$parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . "/$menu_file") && !is_dir(WP_PLUGIN_DIR . "/{$item[2]}") ) || file_exists($menu_file);
   136 					if ( $parent_exists )
   136 					if ( $parent_exists )
   137 						echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";
   137 						echo "<li$class><a href='{$item[2]}?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";
   138 					elseif ( 'admin.php' == $pagenow || !$parent_exists )
   138 					elseif ( 'admin.php' == $pagenow || !$parent_exists )
   139 						echo "<li$class><a href='admin.php?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";
   139 						echo "<li$class><a href='admin.php?page={$sub_item[2]}'$class$tabindex>{$sub_item[0]}</a></li>";