Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/23/2024 01:32:42 AM (18 months ago)
Author:
espellcaste
Message:

WPCS: miscellaneous fixes for cache-related files in several components.

See #9174 and #9173
Closes https://github.com/buddypress/buddypress/pull/331

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-friends/bp-friends-cache.php

    r13092 r13971  
    33 * BuddyPress Friends Caching.
    44 *
    5  * Caching functions handle the clearing of cached objects and pages on specific
    6  * actions throughout BuddyPress.
    7  *
    85 * @package BuddyPress
    9  * @subpackage FriendsCaching
     6 * @subpackage FriendsCache
    107 * @since 1.5.0
    118 */
     
    2118 * @param int $friendship_id ID of the friendship whose two members should
    2219 *                           have their friends cache busted.
    23  * @return bool
    2420 */
    2521function friends_clear_friend_object_cache( $friendship_id ) {
    2622    $friendship = new BP_Friends_Friendship( $friendship_id );
    27     if ( ! $friendship ) {
    28         return false;
     23
     24    if ( empty( $friendship->id ) ) {
     25        return;
    2926    }
    3027
     
    5552
    5653    // Clear incremented cache.
    57     $friendship = new stdClass;
     54    $friendship                    = new stdClass();
    5855    $friendship->initiator_user_id = $initiator_user_id;
    5956    $friendship->friend_user_id    = $friend_user_id;
     
    135132 * @since 3.0.0
    136133 *
    137  * @param BP_Friends_Friendship $friendship The friendship object.
     134 * @param BP_Friends_Friendship|stdClass $friendship The friendship object.
    138135 */
    139136function bp_friends_delete_cached_friendships_on_friendship_save( $friendship ) {
     
    144141
    145142// List actions to clear super cached pages on, if super cache is installed.
    146 add_action( 'friends_friendship_rejected',  'bp_core_clear_cache' );
    147 add_action( 'friends_friendship_accepted',  'bp_core_clear_cache' );
    148 add_action( 'friends_friendship_deleted',   'bp_core_clear_cache' );
     143add_action( 'friends_friendship_rejected', 'bp_core_clear_cache' );
     144add_action( 'friends_friendship_accepted', 'bp_core_clear_cache' );
     145add_action( 'friends_friendship_deleted', 'bp_core_clear_cache' );
    149146add_action( 'friends_friendship_requested', 'bp_core_clear_cache' );
Note: See TracChangeset for help on using the changeset viewer.