Revert oops
git-svn-id: https://develop.svn.wordpress.org/trunk@11603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
6550a221d7
commit
508da6167d
@ -634,10 +634,8 @@ function wp_dashboard_incoming_links_output() {
|
|||||||
|
|
||||||
echo "<ul>\n";
|
echo "<ul>\n";
|
||||||
|
|
||||||
if ( !isset($items) )
|
$count = 0;
|
||||||
$items = 10;
|
foreach ( $rss->get_items() as $item ) {
|
||||||
|
|
||||||
foreach ( $rss->get_items(0, $items) as $item ) {
|
|
||||||
$publisher = '';
|
$publisher = '';
|
||||||
$site_link = '';
|
$site_link = '';
|
||||||
$link = '';
|
$link = '';
|
||||||
|
@ -585,7 +585,7 @@ function uninstall_plugin($plugin) {
|
|||||||
//
|
//
|
||||||
|
|
||||||
function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
|
function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
|
||||||
global $menu, $admin_page_hooks;
|
global $menu, $admin_page_hooks, $_registered_pages;
|
||||||
|
|
||||||
$file = plugin_basename( $file );
|
$file = plugin_basename( $file );
|
||||||
|
|
||||||
@ -602,11 +602,13 @@ function add_menu_page( $page_title, $menu_title, $access_level, $file, $functio
|
|||||||
|
|
||||||
$menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
$menu[] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||||
|
|
||||||
|
$_registered_pages[$hookname] = true;
|
||||||
|
|
||||||
return $hookname;
|
return $hookname;
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
|
function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
|
||||||
global $menu, $admin_page_hooks, $_wp_last_object_menu;
|
global $menu, $admin_page_hooks, $_wp_last_object_menu, $_registered_pages;
|
||||||
|
|
||||||
$file = plugin_basename( $file );
|
$file = plugin_basename( $file );
|
||||||
|
|
||||||
@ -623,11 +625,13 @@ function add_object_page( $page_title, $menu_title, $access_level, $file, $funct
|
|||||||
|
|
||||||
$menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
$menu[$_wp_last_object_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||||
|
|
||||||
|
$_registered_pages[$hookname] = true;
|
||||||
|
|
||||||
return $hookname;
|
return $hookname;
|
||||||
}
|
}
|
||||||
|
|
||||||
function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
|
function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
|
||||||
global $menu, $admin_page_hooks, $_wp_last_utility_menu;
|
global $menu, $admin_page_hooks, $_wp_last_utility_menu, $_registered_pages;
|
||||||
|
|
||||||
$file = plugin_basename( $file );
|
$file = plugin_basename( $file );
|
||||||
|
|
||||||
@ -646,6 +650,8 @@ function add_utility_page( $page_title, $menu_title, $access_level, $file, $func
|
|||||||
|
|
||||||
$menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
$menu[$_wp_last_utility_menu] = array ( $menu_title, $access_level, $file, $page_title, 'menu-top ' . $hookname, $hookname, $icon_url );
|
||||||
|
|
||||||
|
$_registered_pages[$hookname] = true;
|
||||||
|
|
||||||
return $hookname;
|
return $hookname;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,6 +660,7 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi
|
|||||||
global $menu;
|
global $menu;
|
||||||
global $_wp_real_parent_file;
|
global $_wp_real_parent_file;
|
||||||
global $_wp_submenu_nopriv;
|
global $_wp_submenu_nopriv;
|
||||||
|
global $_registered_pages;
|
||||||
|
|
||||||
$file = plugin_basename( $file );
|
$file = plugin_basename( $file );
|
||||||
|
|
||||||
@ -683,6 +690,8 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi
|
|||||||
if (!empty ( $function ) && !empty ( $hookname ))
|
if (!empty ( $function ) && !empty ( $hookname ))
|
||||||
add_action( $hookname, $function );
|
add_action( $hookname, $function );
|
||||||
|
|
||||||
|
$_registered_pages[$hookname] = true;
|
||||||
|
|
||||||
return $hookname;
|
return $hookname;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -919,14 +928,21 @@ function user_can_access_admin_page() {
|
|||||||
global $_wp_menu_nopriv;
|
global $_wp_menu_nopriv;
|
||||||
global $_wp_submenu_nopriv;
|
global $_wp_submenu_nopriv;
|
||||||
global $plugin_page;
|
global $plugin_page;
|
||||||
|
global $_registered_pages;
|
||||||
|
|
||||||
$parent = get_admin_page_parent();
|
$parent = get_admin_page_parent();
|
||||||
|
|
||||||
if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
|
if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
|
if ( isset( $plugin_page ) ) {
|
||||||
return false;
|
if ( isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$hookname = get_plugin_page_hookname($plugin_page, $parent);
|
||||||
|
if ( !isset($_registered_pages[$hookname]) )
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if ( empty( $parent) ) {
|
if ( empty( $parent) ) {
|
||||||
if ( isset( $_wp_menu_nopriv[$pagenow] ) )
|
if ( isset( $_wp_menu_nopriv[$pagenow] ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user