Changes from trunk/wp-admin/includes/plugin.php at r11450 to branches/2.8/wp-admin/includes/plugin.php at r11629
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.8/wp-admin/includes/plugin.php
r11450 r11629 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; 694 // backwards-compatibility for plugins using add_management page. See wp-admin/admin.php for redirect from edit.php to tools.php 695 if ( 'tools.php' == $parent ) 696 $_registered_pages[get_plugin_page_hookname( $file, 'edit.php')] = true; 685 697 686 698 return $hookname; … … 920 932 global $_wp_submenu_nopriv; 921 933 global $plugin_page; 934 global $_registered_pages; 922 935 923 936 $parent = get_admin_page_parent(); … … 926 939 return false; 927 940 928 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) ) 929 return false; 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 } 930 949 931 950 if ( empty( $parent) ) { … … 936 955 if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) ) 937 956 return false; 957 if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) ) 958 return false; 938 959 foreach (array_keys( $_wp_submenu_nopriv ) as $key ) { 939 960 if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) ) … … 944 965 return true; 945 966 } 967 968 if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) ) 969 return false; 946 970 947 971 if ( isset( $submenu[$parent] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.