Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
11/08/2011 01:24:47 AM (15 years ago)
Author:
johnjamesjacoby
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-messages/bp-messages-template.php

    r5301 r5302  
    128128                                if ( 'inbox' == $this->box ) {
    129129                                        foreach ( (array)$this->thread->messages as $key => $message ) {
    130                                                 if ( $bp->loggedin_user->id != $message->sender_id ) {
     130                                                if ( bp_loggedin_user_id() != $message->sender_id ) {
    131131                                                        $last_message_index = $key;
    132132                                                        break;
    … …  
    136136                                } elseif ( 'sentbox' == $this->box ) {
    137137                                        foreach ( (array)$this->thread->messages as $key => $message ) {
    138                                                 if ( $bp->loggedin_user->id == $message->sender_id ) {
     138                                                if ( bp_loggedin_user_id() == $message->sender_id ) {
    139139                                                        $last_message_index = $key;
    140140                                                        break;
    … …  
    160160
    161161        $defaults = array(
    162                 'user_id' => $bp->loggedin_user->id,
     162                'user_id' => bp_loggedin_user_id(),
    163163                'box' => 'inbox',
    164164                'per_page' => 10,
    … …  
    174174        } else {
    175175                if ( 'inbox' == $bp->current_action )
    176                         bp_core_delete_notifications_by_type( $bp->loggedin_user->id, $bp->messages->id, 'new_message' );
     176                        bp_core_delete_notifications_by_type( bp_loggedin_user_id(), $bp->messages->id, 'new_message' );
    177177
    178178                if ( 'sentbox' == $bp->current_action )
    … …  
    781781
    782782                foreach( (array)$thread_template->thread->recipients as $recipient ) {
    783                         if ( $recipient->user_id !== $bp->loggedin_user->id )
     783                        if ( $recipient->user_id !== bp_loggedin_user_id() )
    784784                                $recipient_links[] = bp_core_get_userlink( $recipient->user_id );
    785785                }
Note: See TracChangeset for help on using the changeset viewer.