Skip to:
Content

BuddyPress.org

Changeset 8810


Ignore:
Timestamp:
08/12/2014 01:15:20 PM (10 years ago)
Author:
johnjamesjacoby
Message:

In bp-xprofile-functions.php use bp_disable_profile_sync() where appropriate, ensuring filters are applied in realtime.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-functions.php

    r8809 r8810  
    709709function xprofile_sync_wp_profile( $user_id = 0 ) {
    710710
    711     $bp = buddypress();
    712 
    713     if ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int) $bp->site_options['bp-disable-profile-sync'] )
     711    // Bail if profile syncing is disabled
     712    if ( bp_disable_profile_sync() ) {
    714713        return true;
    715 
    716     if ( empty( $user_id ) )
     714    }
     715
     716    if ( empty( $user_id ) ) {
    717717        $user_id = bp_loggedin_user_id();
    718 
    719     if ( empty( $user_id ) )
    720         return false;
     718    }
     719
     720    if ( empty( $user_id ) ) {
     721        return false;
     722    }
    721723
    722724    $fullname = xprofile_get_field_data( bp_xprofile_fullname_field_id(), $user_id );
     
    751753 */
    752754function xprofile_sync_bp_profile( &$errors, $update, &$user ) {
    753     global $bp;
    754 
    755     if ( ( !empty( $bp->site_options['bp-disable-profile-sync'] ) && (int) $bp->site_options['bp-disable-profile-sync'] ) || !$update || $errors->get_error_codes() )
     755
     756    // Bail if profile syncing is disabled
     757    if ( bp_disable_profile_sync() ) {
    756758        return;
     759    }
    757760
    758761    xprofile_set_field_data( bp_xprofile_fullname_field_id(), $user->ID, $user->display_name );
Note: See TracChangeset for help on using the changeset viewer.