Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/06/2017 05:46:21 PM (8 years ago)
Author:
dcavins
Message:

Show displayed user's messages on messages screens.

When a site administrator visits another user’s messages, she is shown
her own messages because the display logic for messages refers to the
logged-in user rather than the displayed user. This changeset updates
the logic to allow the site admin to view and interact with another
user’s messages.

Fixes #7096.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-messages/bp-messages-functions.php

    r11562 r11578  
    255255
    256256    if ( empty( $user_id ) ) {
    257         $user_id = bp_loggedin_user_id();
     257        $user_id =
     258            bp_displayed_user_id() ?
     259            bp_displayed_user_id() :
     260            bp_loggedin_user_id();
    258261    }
    259262
     
    381384 */
    382385function messages_get_unread_count( $user_id = 0 ) {
    383     if ( empty( $user_id ) ) {
    384         $user_id = bp_loggedin_user_id();
    385     }
    386 
    387386    return BP_Messages_Thread::get_inbox_count( $user_id );
    388387}
Note: See TracChangeset for help on using the changeset viewer.