Skip to:
Content

bbPress.org

Changeset 5926


Ignore:
Timestamp:
08/25/2015 02:32:58 AM (9 years ago)
Author:
johnjamesjacoby
Message:

Favorites: Purge cache when adding/removing a favorite.

This changeset fixes a bug where cache was not busted, causing incorrect results to be returned & displayed.

Props thebrandonallen. See #2855.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/users/functions.php

    r5908 r5926  
    329329        $favorites   = implode( ',', wp_parse_id_list( array_filter( $favorites ) ) );
    330330        update_user_option( $user_id, '_bbp_favorites', $favorites );
     331
     332        // Purge cache
     333        wp_cache_delete( 'bbp_get_topic_favoriters_' . $topic_id, 'bbpress_users' );
    331334    }
    332335
     
    371374            delete_user_option( $user_id, '_bbp_favorites' );
    372375        }
     376
     377        // Purge cache
     378        wp_cache_delete( 'bbp_get_topic_favoriters_' . $topic_id, 'bbpress_users' );
    373379    }
    374380
Note: See TracChangeset for help on using the changeset viewer.