Changeset 13092 for trunk/src/bp-friends/bp-friends-filters.php
- Timestamp:
- 08/24/2021 04:16:17 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-friends/bp-friends-filters.php
r12670 r13092 13 13 // Format numerical output. 14 14 add_filter( 'friends_get_total_friend_count', 'bp_core_number_format' ); 15 add_filter( 'bp_get_total_friend_count', 15 add_filter( 'bp_get_total_friend_count', 'bp_core_number_format' ); 16 16 17 17 /** … … 23 23 * @since 1.7.0 24 24 * 25 * @global WPDB $wpdb WordPress database access object.26 *27 25 * @param BP_User_Query $user_query The BP_User_Query object. 28 26 * @param string $user_ids_sql Comma-separated list of user IDs to fetch extra 29 27 * data for, as determined by BP_User_Query. 30 28 */ 31 function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql ) { 32 global $wpdb; 29 function bp_friends_filter_user_query_populate_extras( $user_query, $user_ids_sql ) { 33 30 34 31 // Stop if user isn't logged in. 35 if ( ! $user_id = bp_loggedin_user_id() ) { 32 $user_id = bp_loggedin_user_id(); 33 if ( ! $user_id ) { 36 34 return; 37 35 } … … 45 43 $status = BP_Friends_Friendship::check_is_friend( $user_id, $friend_id ); 46 44 $user_query->results[ $friend_id ]->friendship_status = $status; 47 if ( 'is_friend' == $status ) {45 if ( 'is_friend' === $status ) { 48 46 $user_query->results[ $friend_id ]->is_friend = 1; 49 47 } 50 48 } 51 52 49 } 53 50 add_filter( 'bp_user_query_populate_extras', 'bp_friends_filter_user_query_populate_extras', 4, 2 );
Note: See TracChangeset
for help on using the changeset viewer.