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-xprofile/bp-xprofile-screens.php

    r5268 r5301  
    9999                    $value = $_POST['field_' . $field_id];
    100100
    101                 if ( !xprofile_set_field_data( $field_id, $bp->displayed_user->id, $value, $is_required[$field_id] ) )
     101                if ( !xprofile_set_field_data( $field_id, bp_displayed_user_id(), $value, $is_required[$field_id] ) )
    102102                    $errors = true;
    103103                else
     
    105105            }
    106106
    107             do_action( 'xprofile_updated_profile', $bp->displayed_user->id, $posted_field_ids, $errors );
     107            do_action( 'xprofile_updated_profile', bp_displayed_user_id(), $posted_field_ids, $errors );
    108108
    109109            // Set the feedback messages
     
    162162        check_admin_referer( 'bp_avatar_cropstore' );
    163163
    164         if ( !bp_core_avatar_handle_crop( array( 'item_id' => $bp->displayed_user->id, 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
     164        if ( !bp_core_avatar_handle_crop( array( 'item_id' => bp_displayed_user_id(), 'original_file' => $_POST['image_src'], 'crop_x' => $_POST['x'], 'crop_y' => $_POST['y'], 'crop_w' => $_POST['w'], 'crop_h' => $_POST['h'] ) ) )
    165165            bp_core_add_message( __( 'There was a problem cropping your avatar, please try uploading it again', 'buddypress' ), 'error' );
    166166        else {
Note: See TracChangeset for help on using the changeset viewer.