Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/06/2017 05:46:21 PM (7 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/classes/class-bp-messages-component.php

    r11577 r11578  
    146146        // Only grab count if we're on a user page and current user has access.
    147147        if ( bp_is_user() && bp_user_has_access() ) {
    148             $count    = bp_get_total_unread_messages_count();
     148            $count    = bp_get_total_unread_messages_count( bp_displayed_user_id() );
    149149            $class    = ( 0 === $count ) ? 'no-count' : 'count';
    150150            $nav_name = sprintf(
     
    253253
    254254            // Unread message count.
    255             $count = messages_get_unread_count();
     255            $count = messages_get_unread_count( bp_loggedin_user_id() );
    256256            if ( !empty( $count ) ) {
    257257                $title = sprintf(
Note: See TracChangeset for help on using the changeset viewer.