Skip to:
Content

Ticket #3030: 3030.diff

File 3030.diff, 1.3 KB (added by anthonycole, 8 years ago)
  • bp-xprofile-functions.php

     
    505505        update_user_meta( $user_id, 'last_name',  $lastname  );
    506506
    507507        $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 ) );
    509508}
    510509add_action( 'xprofile_updated_profile', 'xprofile_sync_wp_profile' );
    511510add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' );
    512511
    513512
    514513/**
     514 * Filters the user url and replaces it with the user domain.
     515 *
     516 * @since 1.3.0
     517 * @package BuddyPress Core
     518 */
     519
     520function 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}
     530add_action( 'get_user_metadata', 'xprofile_filter_user_url' );
     531
     532/**
    515533 * Syncs the standard built in WordPress profile data to XProfile.
    516534 *
    517535 * @since 1.2.4