Ticket #3030: 3030.diff
| File 3030.diff, 1.3 KB (added by , 15 years ago) |
|---|
-
bp-xprofile-functions.php
505 505 update_user_meta( $user_id, 'last_name', $lastname ); 506 506 507 507 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET display_name = %s WHERE ID = %d", $fullname, $user_id ) ); 508 $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_url = %s WHERE ID = %d", bp_core_get_user_domain( $user_id ), $user_id ) );509 508 } 510 509 add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' ); 511 510 add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' ); 512 511 513 512 514 513 /** 514 * Filters the user url and replaces it with the user domain. 515 * 516 * @since 1.3.0 517 * @package BuddyPress Core 518 */ 519 520 function xprofile_filter_user_url( $null, $object_id, $meta_key, $single ) { 521 if( $meta_key != 'user_url' ) 522 return array( null, $object_id, $meta_key, $single ); 523 524 $meta_key = bp_core_get_user_domain( $object_id ); 525 526 apply_filters( 'bp_get_user_url', $meta_key ); 527 528 return array( null, $object_id, $meta_key, $single ); 529 } 530 add_action( 'get_user_metadata', 'xprofile_filter_user_url' ); 531 532 /** 515 533 * Syncs the standard built in WordPress profile data to XProfile. 516 534 * 517 535 * @since 1.2.4