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:
Andrew Nacin 2010-05-06 20:40:10 +00:00
parent 910c8e8bc9
commit 7fcb6fef4b
2 changed files with 6 additions and 6 deletions

View File

@ -558,7 +558,7 @@ class WP_Widget_Recent_Posts extends WP_Widget {
endif;
$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 ) {

View File

@ -906,7 +906,7 @@ function wp_get_archives($args = '') {
if ( !isset( $cache[ $key ] ) ) {
$arcresults = $wpdb->get_results($query);
$cache[ $key ] = $arcresults;
wp_cache_add( 'wp_get_archives', $cache, 'general' );
wp_cache_set( 'wp_get_archives', $cache, 'general' );
} else {
$arcresults = $cache[ $key ];
}
@ -928,7 +928,7 @@ function wp_get_archives($args = '') {
if ( !isset( $cache[ $key ] ) ) {
$arcresults = $wpdb->get_results($query);
$cache[ $key ] = $arcresults;
wp_cache_add( 'wp_get_archives', $cache, 'general' );
wp_cache_set( 'wp_get_archives', $cache, 'general' );
} else {
$arcresults = $cache[ $key ];
}
@ -949,7 +949,7 @@ function wp_get_archives($args = '') {
if ( !isset( $cache[ $key ] ) ) {
$arcresults = $wpdb->get_results($query);
$cache[ $key ] = $arcresults;
wp_cache_add( 'wp_get_archives', $cache, 'general' );
wp_cache_set( 'wp_get_archives', $cache, 'general' );
} else {
$arcresults = $cache[ $key ];
}
@ -972,7 +972,7 @@ function wp_get_archives($args = '') {
if ( !isset( $cache[ $key ] ) ) {
$arcresults = $wpdb->get_results($query);
$cache[ $key ] = $arcresults;
wp_cache_add( 'wp_get_archives', $cache, 'general' );
wp_cache_set( 'wp_get_archives', $cache, 'general' );
} else {
$arcresults = $cache[ $key ];
}
@ -1002,7 +1002,7 @@ function wp_get_archives($args = '') {
if ( !isset( $cache[ $key ] ) ) {
$arcresults = $wpdb->get_results($query);
$cache[ $key ] = $arcresults;
wp_cache_add( 'wp_get_archives', $cache, 'general' );
wp_cache_set( 'wp_get_archives', $cache, 'general' );
} else {
$arcresults = $cache[ $key ];
}