Use wp_cache_set instead of wp_cache_add in recent posts and archives widgets. props Denis-de-Bernardy, fixes #11580.

git-svn-id: http://svn.automattic.com/wordpress/trunk@14486 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2010-05-06 20:40:10 +00:00
parent fa23d1edf0
commit e333d5fc61
2 changed files with 6 additions and 6 deletions

View File

@ -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 ) {

View File

@ -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 ];
} }