Skip to:
Content

BuddyPress.org

Changeset 5631


Ignore:
Timestamp:
01/10/2012 08:51:31 PM (13 years ago)
Author:
boonebgorges
Message:

Cast WP_User object into an array for wp_update_user() early enough for the user_pass field to be unset when passwords are not being changed, in General Settings. Implements a redirect after changing settings, for more reliable display of updated information. Fixes #3918. Props blindMoe, luccame, johnjamesjacoby for help with patching and testing.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5/bp-settings/bp-settings-actions.php

    r5587 r5631  
    2525
    2626            $update_user = get_userdata( $bp->displayed_user->id );
     27           
     28            // The structure of the $update_user object changed in WP 3.3, but
     29            // wp_update_user() still expects the old format
     30            if ( isset( $update_user->data ) && is_object( $update_user->data ) ) {
     31                $update_user = $update_user->data;
     32            }
    2733
    2834            // Make sure changing an email address does not already exist
     
    8187            }
    8288
    83             // The structure of the $update_user object changed in WP 3.3, but
    84             // wp_update_user() still expects the old format
    85             if ( isset( $update_user->data ) && is_object( $update_user->data ) ) {
    86                 $update_user = $update_user->data;
    87             }
    88 
    8989            // Make sure these changes are in $bp for the current page load
    9090            if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( get_object_vars( $update_user ) ) ) ) {
    91                 $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id );
    9291                $bp_settings_updated = true;
    9392            }
     
    113112        // Execute additional code
    114113        do_action( 'bp_core_general_settings_after_save' );
     114       
     115        bp_core_redirect( trailingslashit( bp_displayed_user_domain() . bp_get_settings_slug() . '/general' ) );
    115116    }
    116117
Note: See TracChangeset for help on using the changeset viewer.