Ready to get started?Download WordPress


Does WP_Cache work in 2.7.1? (2 posts)

  1. jeffb0
    Posted 4 years ago #

    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.

  2. mooshmoosh
    Posted 4 years ago #

    I'm having the exact same problem with WP 2.7.1. using the KpicasaGallery Plugin. It doesn't seem to get anything from the cache.

    I'd appreciate any suggestion.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.