Skip to:
Content

BuddyPress.org

Changeset 5796


Ignore:
Timestamp:
02/16/2012 01:40:18 PM (13 years ago)
Author:
boonebgorges
Message:

Swaps _user_meta() functions with BP equivalents. Fixes #4013. Props r-a-y

Location:
trunk
Files:
6 edited

Legend:

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

    r5777 r5796  
    317317        $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities';
    318318
    319         $roles = get_user_meta( $user_id, $key, true );
     319        $roles = bp_get_user_meta( $user_id, $key, true );
    320320
    321321        if ( is_array( $roles ) )
  • trunk/bp-forums/bp-forums-bbpress-sa.php

    r5729 r5796  
    102102        $site_admins = get_site_option( 'site_admins', array('admin') );
    103103        foreach ( (array) $site_admins as $site_admin )
    104             update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
     104            bp_update_user_meta( bp_core_get_userid( $site_admin ), $bb_table_prefix . 'capabilities', array( 'keymaster' => true ) );
    105105
    106106        // Create the first forum.
     
    129129        extract( $args, EXTR_SKIP );
    130130
    131         return update_user_meta( $id, $meta_key, $meta_value );
     131        return bp_update_user_meta( $id, $meta_key, $meta_value );
    132132    }
    133133}
  • trunk/bp-forums/bp-forums-functions.php

    r5729 r5796  
    611611        return $allcaps;
    612612
    613     $bb_cap = get_user_meta( bp_loggedin_user_id(), $bb_table_prefix . 'capabilities', true );
     613    $bb_cap = bp_get_user_meta( bp_loggedin_user_id(), $bb_table_prefix . 'capabilities', true );
    614614
    615615    if ( empty( $bb_cap ) )
  • trunk/bp-members/bp-members-functions.php

    r5782 r5796  
    10741074    // Add the user's fullname to Xprofile
    10751075    if ( bp_is_active( 'xprofile' ) ) {
    1076         $firstname = get_user_meta( $user_id, 'first_name', true );
    1077         $lastname = ' ' . get_user_meta( $user_id, 'last_name', true );
     1076        $firstname = bp_get_user_meta( $user_id, 'first_name', true );
     1077        $lastname = ' ' . bp_get_user_meta( $user_id, 'last_name', true );
    10781078        $name = $firstname . $lastname;
    10791079
    10801080        if ( empty( $name ) || ' ' == $name )
    1081             $name = get_user_meta( $user_id, 'nickname', true );
     1081            $name = bp_get_user_meta( $user_id, 'nickname', true );
    10821082
    10831083        xprofile_set_field_data( 1, $user_id, $name );
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r5794 r5796  
    290290       
    291291        // Get the user's visibility level preferences
    292         $visibility_levels = get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
     292        $visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
    293293       
    294294        foreach( (array)$fields as $key => $field ) {
  • trunk/bp-xprofile/bp-xprofile-functions.php

    r5793 r5796  
    271271   
    272272    // Stored in an array in usermeta
    273     $current_visibility_levels = get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
     273    $current_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
    274274   
    275275    if ( !$current_visibility_levels ) {
     
    279279    $current_visibility_levels[$field_id] = $visibility_level;
    280280   
    281     return update_user_meta( $user_id, 'bp_xprofile_visibility_levels', $current_visibility_levels );
     281    return bp_update_user_meta( $user_id, 'bp_xprofile_visibility_levels', $current_visibility_levels );
    282282}
    283283
     
    442442    }
    443443
    444     update_user_meta( $user_id, 'nickname',   $fullname  );
    445     update_user_meta( $user_id, 'first_name', $firstname );
    446     update_user_meta( $user_id, 'last_name',  $lastname  );
     444    bp_update_user_meta( $user_id, 'nickname',   $fullname  );
     445    bp_update_user_meta( $user_id, 'first_name', $firstname );
     446    bp_update_user_meta( $user_id, 'last_name',  $lastname  );
    447447
    448448    $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) );
     
    476476 * @package BuddyPress XProfile
    477477 * @param $user_id The ID of the deleted user
    478  * @uses get_user_meta() Get a user meta value based on meta key from wp_usermeta
    479  * @uses delete_user_meta() Delete user meta value based on meta key from wp_usermeta
     478 * @uses bp_get_user_meta() Get a user meta value based on meta key from wp_usermeta
     479 * @uses bp_delete_user_meta() Delete user meta value based on meta key from wp_usermeta
    480480 * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user
    481481 */
     
    484484
    485485    // delete any avatar files.
    486     @unlink( get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) );
    487     @unlink( get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) );
     486    @unlink( bp_get_user_meta( $user_id, 'bp_core_avatar_v1_path', true ) );
     487    @unlink( bp_get_user_meta( $user_id, 'bp_core_avatar_v2_path', true ) );
    488488
    489489    // unset the usermeta for avatars from the usermeta table.
    490     delete_user_meta( $user_id, 'bp_core_avatar_v1'      );
    491     delete_user_meta( $user_id, 'bp_core_avatar_v1_path' );
    492     delete_user_meta( $user_id, 'bp_core_avatar_v2'      );
    493     delete_user_meta( $user_id, 'bp_core_avatar_v2_path' );
     490    bp_delete_user_meta( $user_id, 'bp_core_avatar_v1'      );
     491    bp_delete_user_meta( $user_id, 'bp_core_avatar_v1_path' );
     492    bp_delete_user_meta( $user_id, 'bp_core_avatar_v2'      );
     493    bp_delete_user_meta( $user_id, 'bp_core_avatar_v2_path' );
    494494}
    495495add_action( 'wpmu_delete_user',  'xprofile_remove_data' );
     
    721721    }
    722722   
    723     $user_visibility_levels = get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
     723    $user_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
    724724   
    725725    $field_ids = array();
Note: See TracChangeset for help on using the changeset viewer.