Use wp_cache_set instead of wp_cache_add in recent posts and archives widgets. props Denis-de-Bernardy, fixes #11580.
git-svn-id: https://develop.svn.wordpress.org/trunk@14486 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
910c8e8bc9
commit
7fcb6fef4b
|
@ -558,7 +558,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$cache[$args['widget_id']] = ob_get_flush();
|
$cache[$args['widget_id']] = ob_get_flush();
|
||||||
wp_cache_add('widget_recent_posts', $cache, 'widget');
|
wp_cache_set('widget_recent_posts', $cache, 'widget');
|
||||||
}
|
}
|
||||||
|
|
||||||
function update( $new_instance, $old_instance ) {
|
function update( $new_instance, $old_instance ) {
|
||||||
|
|
|
@ -906,7 +906,7 @@ function wp_get_archives($args = '') {
|
||||||
if ( !isset( $cache[ $key ] ) ) {
|
if ( !isset( $cache[ $key ] ) ) {
|
||||||
$arcresults = $wpdb->get_results($query);
|
$arcresults = $wpdb->get_results($query);
|
||||||
$cache[ $key ] = $arcresults;
|
$cache[ $key ] = $arcresults;
|
||||||
wp_cache_add( 'wp_get_archives', $cache, 'general' );
|
wp_cache_set( 'wp_get_archives', $cache, 'general' );
|
||||||
} else {
|
} else {
|
||||||
$arcresults = $cache[ $key ];
|
$arcresults = $cache[ $key ];
|
||||||
}
|
}
|
||||||
|
@ -928,7 +928,7 @@ function wp_get_archives($args = '') {
|
||||||
if ( !isset( $cache[ $key ] ) ) {
|
if ( !isset( $cache[ $key ] ) ) {
|
||||||
$arcresults = $wpdb->get_results($query);
|
$arcresults = $wpdb->get_results($query);
|
||||||
$cache[ $key ] = $arcresults;
|
$cache[ $key ] = $arcresults;
|
||||||
wp_cache_add( 'wp_get_archives', $cache, 'general' );
|
wp_cache_set( 'wp_get_archives', $cache, 'general' );
|
||||||
} else {
|
} else {
|
||||||
$arcresults = $cache[ $key ];
|
$arcresults = $cache[ $key ];
|
||||||
}
|
}
|
||||||
|
@ -949,7 +949,7 @@ function wp_get_archives($args = '') {
|
||||||
if ( !isset( $cache[ $key ] ) ) {
|
if ( !isset( $cache[ $key ] ) ) {
|
||||||
$arcresults = $wpdb->get_results($query);
|
$arcresults = $wpdb->get_results($query);
|
||||||
$cache[ $key ] = $arcresults;
|
$cache[ $key ] = $arcresults;
|
||||||
wp_cache_add( 'wp_get_archives', $cache, 'general' );
|
wp_cache_set( 'wp_get_archives', $cache, 'general' );
|
||||||
} else {
|
} else {
|
||||||
$arcresults = $cache[ $key ];
|
$arcresults = $cache[ $key ];
|
||||||
}
|
}
|
||||||
|
@ -972,7 +972,7 @@ function wp_get_archives($args = '') {
|
||||||
if ( !isset( $cache[ $key ] ) ) {
|
if ( !isset( $cache[ $key ] ) ) {
|
||||||
$arcresults = $wpdb->get_results($query);
|
$arcresults = $wpdb->get_results($query);
|
||||||
$cache[ $key ] = $arcresults;
|
$cache[ $key ] = $arcresults;
|
||||||
wp_cache_add( 'wp_get_archives', $cache, 'general' );
|
wp_cache_set( 'wp_get_archives', $cache, 'general' );
|
||||||
} else {
|
} else {
|
||||||
$arcresults = $cache[ $key ];
|
$arcresults = $cache[ $key ];
|
||||||
}
|
}
|
||||||
|
@ -1002,7 +1002,7 @@ function wp_get_archives($args = '') {
|
||||||
if ( !isset( $cache[ $key ] ) ) {
|
if ( !isset( $cache[ $key ] ) ) {
|
||||||
$arcresults = $wpdb->get_results($query);
|
$arcresults = $wpdb->get_results($query);
|
||||||
$cache[ $key ] = $arcresults;
|
$cache[ $key ] = $arcresults;
|
||||||
wp_cache_add( 'wp_get_archives', $cache, 'general' );
|
wp_cache_set( 'wp_get_archives', $cache, 'general' );
|
||||||
} else {
|
} else {
|
||||||
$arcresults = $cache[ $key ];
|
$arcresults = $cache[ $key ];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue