Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/23/2017 05:34:06 PM (7 years ago)
Author:
r-a-y
Message:

Messages: Do not show message content in message threads from deleted users.

If a user no longer exists, do not show the message content and replace
with a [deleted] marker.

See #7523.

File:
1 edited

Legend:

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

    r11598 r11612  
    20122012        global $thread_template;
    20132013
     2014        $content = $thread_template->message->message;
     2015
     2016        // If user was deleted, mark content as deleted.
     2017        if ( false === bp_core_get_core_userdata( bp_get_the_thread_message_sender_id() ) ) {
     2018            $content = esc_html__( '[deleted]', 'buddypress' );
     2019        }
     2020
    20142021        /**
    20152022         * Filters the content of the current message in the loop.
     
    20192026         * @param string $message The content of the current message in the loop.
    20202027         */
    2021         return apply_filters( 'bp_get_the_thread_message_content', $thread_template->message->message );
     2028        return apply_filters( 'bp_get_the_thread_message_content', $content );
    20222029    }
    20232030
Note: See TracChangeset for help on using the changeset viewer.