Ticket #4013: 4013.01.patch
File 4013.01.patch, 6.4 KB (added by , 13 years ago) |
---|
-
bp-blogs/bp-blogs-functions.php
316 316 if ( empty( $role ) ) { 317 317 $key = $wpdb->get_blog_prefix( $blog_id ). 'capabilities'; 318 318 319 $roles = get_user_meta( $user_id, $key, true );319 $roles = bp_get_user_meta( $user_id, $key, true ); 320 320 321 321 if ( is_array( $roles ) ) 322 322 $role = array_search( 1, $roles ); -
bp-forums/bp-forums-bbpress-sa.php
101 101 // Set the site admins as the keymasters 102 102 $site_admins = get_site_option( 'site_admins', array('admin') ); 103 103 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 ) ); 105 105 106 106 // Create the first forum. 107 107 bb_new_forum( array( 'forum_name' => 'Default Forum' ) ); … … 128 128 $args = wp_parse_args( $args, $defaults ); 129 129 extract( $args, EXTR_SKIP ); 130 130 131 return update_user_meta( $id, $meta_key, $meta_value );131 return bp_update_user_meta( $id, $meta_key, $meta_value ); 132 132 } 133 133 } 134 134 -
bp-forums/bp-forums-functions.php
610 610 if ( !bp_loggedin_user_id() ) 611 611 return $allcaps; 612 612 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 ); 614 614 615 615 if ( empty( $bb_cap ) ) 616 616 return $allcaps; -
bp-members/bp-members-functions.php
1073 1073 1074 1074 // Add the user's fullname to Xprofile 1075 1075 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 ); 1078 1078 $name = $firstname . $lastname; 1079 1079 1080 1080 if ( empty( $name ) || ' ' == $name ) 1081 $name = get_user_meta( $user_id, 'nickname', true );1081 $name = bp_get_user_meta( $user_id, 'nickname', true ); 1082 1082 1083 1083 xprofile_set_field_data( 1, $user_id, $name ); 1084 1084 } -
bp-xprofile/bp-xprofile-classes.php
289 289 global $wpdb, $bp; 290 290 291 291 // 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 ); 293 293 294 294 foreach( (array)$fields as $key => $field ) { 295 295 // Look to see if the user has set the visibility for this field -
bp-xprofile/bp-xprofile-functions.php
270 270 } 271 271 272 272 // 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 ); 274 274 275 275 if ( !$current_visibility_levels ) { 276 276 $current_visibility_levels = array(); … … 278 278 279 279 $current_visibility_levels[$field_id] = $visibility_level; 280 280 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 ); 282 282 } 283 283 284 284 function xprofile_delete_field_data( $field, $user_id ) { … … 441 441 $lastname = trim( substr( $fullname, $space, strlen( $fullname ) ) ); 442 442 } 443 443 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 ); 447 447 448 448 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) ); 449 449 } … … 475 475 * 476 476 * @package BuddyPress XProfile 477 477 * @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_usermeta479 * @uses delete_user_meta() Delete user meta value based on meta key from wp_usermeta478 * @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 480 480 * @uses delete_data_for_user() Removes all profile data from the xprofile tables for the user 481 481 */ 482 482 function xprofile_remove_data( $user_id ) { 483 483 BP_XProfile_ProfileData::delete_data_for_user( $user_id ); 484 484 485 485 // 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 ) ); 488 488 489 489 // 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' ); 494 494 } 495 495 add_action( 'wpmu_delete_user', 'xprofile_remove_data' ); 496 496 add_action( 'delete_user', 'xprofile_remove_data' ); … … 720 720 $levels = (array)$levels; 721 721 } 722 722 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 ); 724 724 725 725 $field_ids = array(); 726 726 foreach( (array)$user_visibility_levels as $field_id => $field_visibility ) {