Skip to:
Content

BuddyPress.org

Changeset 8081


Ignore:
Timestamp:
03/08/2014 12:33:15 PM (6 years ago)
Author:
boonebgorges
Message:

Improve variable naming in bp_get_member_profile_data()

The overuse of the $user_id variable, combined with the ill-advised use of
explode(), was resulting in situations where it was impossible to pass a custom
value of $user_id to the function.

See #5334

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-template.php

    r7846 r8081  
    665665
    666666        // Declare local variables
    667         $data    = false;
    668         $user_id = 0;
     667        $data = false;
    669668
    670669        // Guess at default $user_id
     670        $default_user_id = 0;
    671671        if ( !empty( $members_template->member->id ) )
    672             $user_id = $members_template->member->id;
     672            $default_user_id = $members_template->member->id;
    673673        elseif ( bp_displayed_user_id() )
    674             $user_id = bp_displayed_user_id();
     674            $default_user_id = bp_displayed_user_id();
    675675
    676676        $defaults = array(
    677             'field'   => false,   // Field name
    678             'user_id' => $user_id
     677            'field'   => false,
     678            'user_id' => $default_user_id,
    679679        );
    680680
Note: See TracChangeset for help on using the changeset viewer.