Changes from branches/2.8/wp-admin/includes/plugin.php at r11629 to trunk/wp-admin/includes/plugin.php at r11450
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/plugin.php
r11629 r11450 586 586 587 587 function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) { 588 global $menu, $admin_page_hooks , $_registered_pages;588 global $menu, $admin_page_hooks; 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 607 605 return $hookname; 608 606 } 609 607 610 608 function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 611 global $menu, $admin_page_hooks, $_wp_last_object_menu , $_registered_pages;609 global $menu, $admin_page_hooks, $_wp_last_object_menu; 612 610 613 611 $file = plugin_basename( $file ); … … 626 624 $menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url ); 627 625 628 $_registered_pages[$hookname] = true;629 630 626 return $hookname; 631 627 } 632 628 633 629 function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') { 634 global $menu, $admin_page_hooks, $_wp_last_utility_menu , $_registered_pages;630 global $menu, $admin_page_hooks, $_wp_last_utility_menu; 635 631 636 632 $file = plugin_basename( $file ); … … 650 646 651 647 $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;654 648 655 649 return $hookname; … … 661 655 global $_wp_real_parent_file; 662 656 global $_wp_submenu_nopriv; 663 global $_registered_pages;664 657 665 658 $file = plugin_basename( $file ); … … 690 683 if (!empty ( $function ) && !empty ( $hookname )) 691 684 add_action( $hookname, $function ); 692 693 $_registered_pages[$hookname] = true;694 // backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php695 if ( 'tools.php' == $parent )696 $_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true;697 685 698 686 return $hookname; … … 932 920 global $_wp_submenu_nopriv; 933 921 global $plugin_page; 934 global $_registered_pages;935 922 936 923 $parent = get_admin_page_parent(); … … 939 926 return false; 940 927 941 if ( isset( $plugin_page ) ) { 942 if ( isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 943 return false; 944 945 $hookname = get_plugin_page_hookname($plugin_page, $parent); 946 if ( !isset($_registered_pages[$hookname]) ) 947 return false; 948 } 928 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 929 return false; 949 930 950 931 if ( empty( $parent) ) { … … 955 936 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) 956 937 return false; 957 if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) )958 return false;959 938 foreach (array_keys( $_wp_submenu_nopriv ) as $key ) { 960 939 if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) ) … … 965 944 return true; 966 945 } 967 968 if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) )969 return false;970 946 971 947 if ( isset( $submenu[$parent] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.