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:
parent
fa23d1edf0
commit
e333d5fc61
|
@ -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 ) {
|
||||
|
|
|
@ -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 ];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue