Skip to:
Content

BuddyPress.org

Ticket #4013: 4013.01.patch

File 4013.01.patch, 6.4 KB (added by r-a-y, 13 years ago)
  • bp-blogs/bp-blogs-functions.php

     
    316316        if ( empty( $role ) ) {
    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 ) )
    322322                        $role = array_search( 1, $roles );
  • bp-forums/bp-forums-bbpress-sa.php

     
    101101                // Set the site admins as the keymasters
    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.
    107107                bb_new_forum( array( 'forum_name' => 'Default Forum' ) );
     
    128128                $args = wp_parse_args( $args, $defaults );
    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}
    134134
  • bp-forums/bp-forums-functions.php

     
    610610        if ( !bp_loggedin_user_id() )
    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 ) )
    616616                return $allcaps;
  • bp-members/bp-members-functions.php

     
    10731073
    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 );
    10841084        }
  • bp-xprofile/bp-xprofile-classes.php

     
    289289                global $wpdb, $bp;
    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 ) {
    295295                        // Look to see if the user has set the visibility for this field
  • bp-xprofile/bp-xprofile-functions.php

     
    270270        }
    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 ) {
    276276                $current_visibility_levels = array();
     
    278278       
    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
    284284function xprofile_delete_field_data( $field, $user_id ) {
     
    441441                $lastname = trim( substr( $fullname, $space, strlen( $fullname ) ) );
    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 ) );
    449449}
     
    475475 *
    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 */
    482482function xprofile_remove_data( $user_id ) {
    483483        BP_XProfile_ProfileData::delete_data_for_user( $user_id );
    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' );
    496496add_action( 'delete_user',       'xprofile_remove_data' );
     
    720720                $levels = (array)$levels;
    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();
    726726        foreach( (array)$user_visibility_levels as $field_id => $field_visibility ) {