Revert unrelated code from [17765].
git-svn-id: https://develop.svn.wordpress.org/trunk@17766 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c3ed3b072e
commit
586f141545
@ -925,17 +925,9 @@ function wp_dashboard_plugins() {
|
|||||||
* @since 2.5.0
|
* @since 2.5.0
|
||||||
*/
|
*/
|
||||||
function wp_dashboard_plugins_output() {
|
function wp_dashboard_plugins_output() {
|
||||||
ob_start();
|
$popular = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/popular/' );
|
||||||
$check_urls = array(
|
$new = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/new/' );
|
||||||
'http://wordpress.org/extend/plugins/rss/browse/popular/',
|
$updated = fetch_feed( 'http://wordpress.org/extend/plugins/rss/browse/updated/' );
|
||||||
'http://wordpress.org/extend/plugins/rss/browse/new/',
|
|
||||||
'http://wordpress.org/extend/plugins/rss/browse/updated/'
|
|
||||||
);
|
|
||||||
$transient_key = __FUNCTION__ . serialize( '' ) . implode( '|', $check_urls );
|
|
||||||
|
|
||||||
$popular = fetch_feed( $check_urls[0] );
|
|
||||||
$new = fetch_feed( $check_urls[1] );
|
|
||||||
$updated = fetch_feed( $check_urls[2] );
|
|
||||||
|
|
||||||
if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
|
if ( false === $plugin_slugs = get_transient( 'plugin_slugs' ) ) {
|
||||||
$plugin_slugs = array_keys( get_plugins() );
|
$plugin_slugs = array_keys( get_plugins() );
|
||||||
@ -1006,7 +998,6 @@ function wp_dashboard_plugins_output() {
|
|||||||
$$feed->__destruct();
|
$$feed->__destruct();
|
||||||
unset($$feed);
|
unset($$feed);
|
||||||
}
|
}
|
||||||
set_transient( $transient_key, ob_get_flush() );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1027,13 +1018,10 @@ function wp_dashboard_plugins_output() {
|
|||||||
function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
|
function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = array() ) {
|
||||||
$loading = '<p class="widget-loading">' . __( 'Loading…' ) . '</p>';
|
$loading = '<p class="widget-loading">' . __( 'Loading…' ) . '</p>';
|
||||||
|
|
||||||
$widgets = get_option( 'dashboard_widget_options' );
|
|
||||||
$output_cache = 'dashboard_' . md5( $callback . serialize( isset( $widgets[$widget_id] ) ? $widgets[$widget_id] : '' ) . implode( '|', $check_urls ) );
|
|
||||||
|
|
||||||
if ( empty($check_urls) ) {
|
if ( empty($check_urls) ) {
|
||||||
|
$widgets = get_option( 'dashboard_widget_options' );
|
||||||
if ( empty($widgets[$widget_id]['url']) ) {
|
if ( empty($widgets[$widget_id]['url']) ) {
|
||||||
echo $loading;
|
echo $loading;
|
||||||
delete_transient( $output_cache );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$check_urls = array( $widgets[$widget_id]['url'] );
|
$check_urls = array( $widgets[$widget_id]['url'] );
|
||||||
@ -1044,19 +1032,10 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar
|
|||||||
$cache = new WP_Feed_Cache_Transient('', md5($check_url), '');
|
$cache = new WP_Feed_Cache_Transient('', md5($check_url), '');
|
||||||
if ( ! $cache->load() ) {
|
if ( ! $cache->load() ) {
|
||||||
echo $loading;
|
echo $loading;
|
||||||
delete_transient( $output_cache );
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( false === $cache = get_transient( $output_cache ) ) {
|
|
||||||
echo $loading;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
echo $cache;
|
|
||||||
return true;
|
|
||||||
/*
|
|
||||||
if ( $callback && is_callable( $callback ) ) {
|
if ( $callback && is_callable( $callback ) ) {
|
||||||
$args = array_slice( func_get_args(), 2 );
|
$args = array_slice( func_get_args(), 2 );
|
||||||
array_unshift( $args, $widget_id );
|
array_unshift( $args, $widget_id );
|
||||||
@ -1064,7 +1043,6 @@ function wp_dashboard_cached_rss_widget( $widget_id, $callback, $check_urls = ar
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Dashboard Widgets Controls */
|
/* Dashboard Widgets Controls */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user