Enforce incoming links item limit

git-svn-id: http://svn.automattic.com/wordpress/trunk@11602 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2009-06-19 06:07:25 +00:00
parent 3737553e65
commit 5f37d31754
2 changed files with 9 additions and 23 deletions

View File

@ -634,8 +634,10 @@ function wp_dashboard_incoming_links_output() {
echo "<ul>\n";
$count = 0;
foreach ( $rss->get_items() as $item ) {
if ( !isset($items) )
$items = 10;
foreach ( $rss->get_items(0, $items) as $item ) {
$publisher = '';
$site_link = '';
$link = '';

View File

@ -585,7 +585,7 @@ function uninstall_plugin($plugin) {
//
function add_menu_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '' ) {
global $menu, $admin_page_hooks, $_registered_pages;
global $menu, $admin_page_hooks;
$file = plugin_basename( $file );
@ -602,13 +602,11 @@ 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 );
$_registered_pages[$hookname] = true;
return $hookname;
}
function add_object_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
global $menu, $admin_page_hooks, $_wp_last_object_menu, $_registered_pages;
global $menu, $admin_page_hooks, $_wp_last_object_menu;
$file = plugin_basename( $file );
@ -625,13 +623,11 @@ 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 );
$_registered_pages[$hookname] = true;
return $hookname;
}
function add_utility_page( $page_title, $menu_title, $access_level, $file, $function = '', $icon_url = '') {
global $menu, $admin_page_hooks, $_wp_last_utility_menu, $_registered_pages;
global $menu, $admin_page_hooks, $_wp_last_utility_menu;
$file = plugin_basename( $file );
@ -650,8 +646,6 @@ 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 );
$_registered_pages[$hookname] = true;
return $hookname;
}
@ -660,7 +654,6 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi
global $menu;
global $_wp_real_parent_file;
global $_wp_submenu_nopriv;
global $_registered_pages;
$file = plugin_basename( $file );
@ -690,8 +683,6 @@ function add_submenu_page( $parent, $page_title, $menu_title, $access_level, $fi
if (!empty ( $function ) && !empty ( $hookname ))
add_action( $hookname, $function );
$_registered_pages[$hookname] = true;
return $hookname;
}
@ -928,21 +919,14 @@ function user_can_access_admin_page() {
global $_wp_menu_nopriv;
global $_wp_submenu_nopriv;
global $plugin_page;
global $_registered_pages;
$parent = get_admin_page_parent();
if ( !isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$pagenow] ) )
return false;
if ( isset( $plugin_page ) ) {
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 ( isset( $plugin_page ) && isset( $_wp_submenu_nopriv[$parent][$plugin_page] ) )
return false;
if ( empty( $parent) ) {
if ( isset( $_wp_menu_nopriv[$pagenow] ) )