Changeset 1912
- Timestamp:
- 12/04/04 05:02:07 (4 years ago)
- Files:
-
- trunk/wp-admin/admin-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/admin-functions.php
r1908 r1912 745 745 function add_submenu_page($parent, $page_title, $menu_title, $access_level, $file) { 746 746 global $submenu; 747 747 global $menu; 748 749 $parent = plugin_basename($parent); 748 750 $file = plugin_basename($file); 749 751 752 // If the parent doesn't already have a submenu, add a link to the parent 753 // as the first item in the submenu. If the submenu file is the same as the 754 // parent file someone is trying to link back to the parent manually. In 755 // this case, don't automatically add a link back to avoid duplication. 756 if (! isset($submenu[$parent]) && $file != $parent) { 757 foreach ($menu as $parent_menu) { 758 if ($parent_menu[2] == $parent) { 759 $submenu[$parent][] = $parent_menu; 760 } 761 } 762 } 763 750 764 $submenu[$parent][] = array($menu_title, $access_level, $file, $page_title); 751 765 }
