Skip to:
Content

BuddyPress.org

Ticket #2315: 2315.patch

File 2315.patch, 906 bytes (added by DJPaul, 15 years ago)
  • bp-xprofile.php

     
    927927add_action( 'bp_core_signup_user', 'xprofile_sync_wp_profile' );
    928928
    929929/**
     930 * xprofile_sync_bp_profile
     931 *
     932 * Syncs the standard built in WordPress profile data to Xprofile.
     933 *
     934 * @package BuddyPress Core
     935 */
     936function xprofile_sync_bp_profile( &$errors, $update, &$user ) {
     937        global $bp;
     938
     939        if ( (int)$bp->site_options['bp-disable-profile-sync'] || !$update || $errors->get_error_codes() )
     940                return;
     941
     942        xprofile_set_field_data( BP_XPROFILE_FULLNAME_FIELD_NAME, $user->ID, $user->display_name );
     943}
     944add_action( 'user_profile_update_errors', 'xprofile_sync_bp_profile', 10, 3 );
     945
     946/**
    930947 * xprofile_remove_screen_notifications()
    931948 *
    932949 * Removes notifications from the notification menu when a user clicks on them and