Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/24/2021 04:16:17 AM (3 years ago)
Author:
espellcaste
Message:

Making PHPDoc Improvements to the BP Friends (component) files.

Also, adding several minor PHP changes.

See #8553

File:
1 edited

Legend:

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

    r12670 r13092  
    1313// Format numerical output.
    1414add_filter( 'friends_get_total_friend_count', 'bp_core_number_format' );
    15 add_filter( 'bp_get_total_friend_count',      'bp_core_number_format' );
     15add_filter( 'bp_get_total_friend_count', 'bp_core_number_format' );
    1616
    1717/**
     
    2323 * @since 1.7.0
    2424 *
    25  * @global WPDB $wpdb WordPress database access object.
    26  *
    2725 * @param BP_User_Query $user_query   The BP_User_Query object.
    2826 * @param string        $user_ids_sql Comma-separated list of user IDs to fetch extra
    2927 *                                    data for, as determined by BP_User_Query.
    3028 */
    31 function bp_friends_filter_user_query_populate_extras( BP_User_Query $user_query, $user_ids_sql ) {
    32     global $wpdb;
     29function bp_friends_filter_user_query_populate_extras( $user_query, $user_ids_sql ) {
    3330
    3431    // 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 ) {
    3634        return;
    3735    }
     
    4543        $status = BP_Friends_Friendship::check_is_friend( $user_id, $friend_id );
    4644        $user_query->results[ $friend_id ]->friendship_status = $status;
    47         if ( 'is_friend' == $status ) {
     45        if ( 'is_friend' === $status ) {
    4846            $user_query->results[ $friend_id ]->is_friend = 1;
    4947        }
    5048    }
    51 
    5249}
    5350add_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.