Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 01:14:31 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Use bp_displayed_user_id() rather than reference the $bp->displayed_user->id global var directly. First step at consolidating user ID checks to use WP_User class later. See #3738.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-settings/bp-settings-actions.php

    r5232 r5301  
    2222
    2323        // Validate the user again for the current password when making a big change
    24         if ( is_super_admin() || ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, $bp->displayed_user->id ) ) ) {
     24        if ( is_super_admin() || ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password( $_POST['pwd'], $bp->displayed_user->userdata->user_pass, bp_displayed_user_id() ) ) ) {
    2525
    26             $update_user = get_userdata( $bp->displayed_user->id );
     26            $update_user = get_userdata( bp_displayed_user_id() );
    2727
    2828            // Make sure changing an email address does not already exist
     
    8383            // Make sure these changes are in $bp for the current page load
    8484            if ( ( false === $email_error ) && ( false === $pass_error ) && ( wp_update_user( get_object_vars( $update_user ) ) ) ) {
    85                 $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id );
     85                $bp->displayed_user->userdata = bp_core_get_core_userdata( bp_displayed_user_id() );
    8686                $bp_settings_updated = true;
    8787            }
     
    129129            foreach ( (array)$_POST['notifications'] as $key => $value ) {
    130130                if ( $meta_key = bp_get_user_meta_key( $key ) )
    131                     bp_update_user_meta( (int)$bp->displayed_user->id, $meta_key, $value );
     131                    bp_update_user_meta( (int)bp_displayed_user_id(), $meta_key, $value );
    132132            }
    133133        }
     
    156156
    157157        // delete the users account
    158         if ( bp_core_delete_account( $bp->displayed_user->id ) ) {
     158        if ( bp_core_delete_account( bp_displayed_user_id() ) ) {
    159159            bp_core_redirect( home_url() );
    160160        }
Note: See TracChangeset for help on using the changeset viewer.