git-svn-id: http://svn.automattic.com/wordpress/trunk@4093 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2006-08-14 21:24:43 +00:00
parent 756caab182
commit 3b33ed195d
2 changed files with 34 additions and 23 deletions

View File

@@ -1489,13 +1489,19 @@ function add_submenu_page($parent, $page_title, $menu_title, $access_level, $fil
global $submenu;
global $menu;
global $real_parent_file;
global $menu_nopriv;
$file = plugin_basename($file);
//echo "Adding $parent $file $access_level<br />";
if ( !current_user_can($access_level) ) {
$menu_nopriv[$file] = true;
return false;
}
$parent = plugin_basename($parent);
if ( isset($real_parent_file[$parent]) )
$parent = $real_parent_file[$parent];
$file = plugin_basename($file);
// If the parent doesn't already have a submenu, add a link to the parent
// as the first item in the submenu. If the submenu file is the same as the
// parent file someone is trying to link back to the parent manually. In