Changeset 11596
- Timestamp:
- 06/18/2009 12:33:51 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/wp-admin/includes/plugin.php
r11593 r11596 586 586 587 587 function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) { 588 global $menu, $admin_page_hooks ;588 global $menu, $admin_page_hooks, $_registered_pages; 589 589 590 590 $file = plugin_basename( $file ); … … 603 603 $menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 604 604 605 $_registered_pages[$hookname] = true; 606 605 607 return $hookname; 606 608 } 607 609 608 610 function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 609 global $menu, $admin_page_hooks, $_wp_last_object_menu ;611 global $menu, $admin_page_hooks, $_wp_last_object_menu, $_registered_pages; 610 612 611 613 $file = plugin_basename( $file ); … … 624 626 $menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 625 627 628 $_registered_pages[$hookname] = true; 629 626 630 return $hookname; 627 631 } 628 632 629 633 function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 630 global $menu, $admin_page_hooks, $_wp_last_utility_menu ;634 global $menu, $admin_page_hooks, $_wp_last_utility_menu, $_registered_pages; 631 635 632 636 $file = plugin_basename( $file ); … … 646 650 647 651 $menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 652 653 $_registered_pages[$hookname] = true; 648 654 649 655 return $hookname; … … 655 661 global $_wp_real_parent_file; 656 662 global $_wp_submenu_nopriv; 663 global $_registered_pages; 657 664 658 665 $file = plugin_basename( $file ); … … 683 690 if (!empty ( $function ) && !empty ( $hookname )) 684 691 add_action( $hookname, $function ); 692 693 $_registered_pages[$hookname] = true; 685 694 686 695 return $hookname; … … 920 929 global $_wp_submenu_nopriv; 921 930 global $plugin_page; 931 global $_registered_pages; 922 932 923 933 $parent = get_admin_page_parent(); … … 926 936 return false; 927 937 928 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 929 return false; 938 if ( isset( $plugin_page ) ) { 939 if ( isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 940 return false; 941 942 $hookname = get_plugin_page_hookname($plugin_page, $parent); 943 if ( !isset($_registered_pages[$hookname]) ) 944 return false; 945 } 930 946 931 947 if ( empty( $parent) ) {
Note: See TracChangeset
for help on using the changeset viewer.