Does WP_Cache work in 2.7.1?
-
Has wp_cache been disabled for plugin/theme authors?
I can’t seem to get wp_cache_get() to retrieve my data, even though a print_r() shows it’s been added by wp_cache_add(), however only for one page-load.
‘WP_CACHE’, true has been added to my config in the proper place.
Here is my code:
global $wpdb; $data = wp_cache_get( 'foo_all_terms', 'all_terms' ); if ( !data ) { echo 'FALSE!! GETTING TERMS and ADDING to CACHE!!'; $query = "SELECT name FROM $wpdb->terms"; $data = $wpdb->get_col( $query ); // array wp_cache_add( 'foo_all_terms', $data, 'all_terms' ); }
Thanks, this is really driving me nuts.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Does WP_Cache work in 2.7.1?’ is closed to new replies.