Skip to:
Content

BuddyPress.org

Changeset 8691


Ignore:
Timestamp:
07/24/2014 08:49:06 AM (5 years ago)
Author:
djpaul
Message:

xProfile: when a user's profile is updated, correctly pass the fields' previous values to the xprofile_updated_profile action.

Fixes #5755 (branch), props Viper007Bond

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/bp-xprofile/bp-xprofile-screens.php

    r8292 r8691  
    109109                $value = isset( $_POST['field_' . $field_id] ) ? $_POST['field_' . $field_id] : '';
    110110
    111                 if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) {
    112                     $errors = true;
    113                 } else {
    114                     do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
    115                 }
    116 
    117                 // Save the visibility level
    118111                $visibility_level = !empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public';
    119                 xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
    120112
    121113                // Save the old and new values. They will be
     
    130122                    'visibility' => $visibility_level,
    131123                );
     124
     125                if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) ) {
     126                    $errors = true;
     127                } else {
     128                    do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
     129                }
     130
     131                // Save the visibility level
     132                xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
    132133            }
    133134
Note: See TracChangeset for help on using the changeset viewer.