Make WordPress Core


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/plugin.php

    r11629 r11450  
    586586
    587587function 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;
    589589
    590590    $file = plugin_basename( $file );
     
    603603    $menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    604604
    605     $_registered_pages[$hookname] = true;
    606 
    607605    return $hookname;
    608606}
    609607
    610608function 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;
    612610
    613611    $file = plugin_basename( $file );
     
    626624    $menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
    627625
    628     $_registered_pages[$hookname] = true;
    629 
    630626    return $hookname;
    631627}
    632628
    633629function 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;
    635631
    636632    $file = plugin_basename( $file );
     
    650646
    651647    $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;
    654648
    655649    return $hookname;
     
    661655    global $_wp_real_parent_file;
    662656    global $_wp_submenu_nopriv;
    663     global $_registered_pages;
    664657
    665658    $file = plugin_basename( $file );
     
    690683    if (!empty ( $function ) && !empty ( $hookname ))
    691684        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;
    697685
    698686    return $hookname;
     
    932920    global $_wp_submenu_nopriv;
    933921    global $plugin_page;
    934     global $_registered_pages;
    935922
    936923    $parent = get_admin_page_parent();
     
    939926        return false;
    940927
    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;
    949930
    950931    if ( empty( $parent) ) {
     
    955936        if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$pagenow][$plugin_page] ) )
    956937            return false;
    957         if ( isset( $plugin_page ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
    958             return false;
    959938        foreach (array_keys( $_wp_submenu_nopriv ) as $key ) {
    960939            if ( isset( $_wp_submenu_nopriv[$key][$pagenow] ) )
     
    965944        return true;
    966945    }
    967 
    968     if ( isset( $plugin_page ) && ( $plugin_page == $parent ) && isset( $_wp_menu_nopriv[$plugin_page] ) )
    969         return false;
    970946
    971947    if ( isset( $submenu[$parent] ) ) {
Note: See TracChangeset for help on using the changeset viewer.