Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/14/2012 08:13:13 PM (13 years ago)
Author:
djpaul
Message:

Prevent a user's "total friends" count from not being cleared from a persistent object cache.

  • Removed redundant BP wp_cache use as WP user meta has its own caching built-in.
  • Fixes #4226
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-friends/bp-friends-functions.php

    r6093 r6101  
    171171
    172172function friends_get_total_friend_count( $user_id = 0 ) {
    173 
    174173    if ( empty( $user_id ) )
    175174        $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
    176175
    177     if ( !$count = wp_cache_get( 'bp_total_friend_count_' . $user_id, 'bp' ) ) {
    178         $count = bp_get_user_meta( $user_id, 'total_friend_count', true );
    179         if ( empty( $count ) ) $count = 0;
    180         wp_cache_set( 'bp_total_friend_count_' . $user_id, $count, 'bp' );
    181     }
     176    $count = bp_get_user_meta( $user_id, 'total_friend_count', true );
     177    if ( empty( $count ) )
     178        $count = 0;
    182179
    183180    return apply_filters( 'friends_get_total_friend_count', $count );
Note: See TracChangeset for help on using the changeset viewer.