Skip to:
Content

BuddyPress.org

Changeset 8070


Ignore:
Timestamp:
03/06/2014 08:30:49 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Messages: Introduce template functions for getting and outputting the last message in a single thread when in the inbox/sentbox loop. Props boonebgorges. Fixes #5176.

File:
1 edited

Legend:

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

    r7965 r8070  
    256256
    257257                return apply_filters( 'bp_get_message_thread_excerpt', strip_tags( bp_create_excerpt( $messages_template->thread->last_message_content, 75 ) ) );
     258        }
     259
     260/**
     261 * Output the thread's last message content
     262 *
     263 * When viewing your Inbox, the last message is the most recent message in
     264 * the thread of which you are *not* the author.
     265 *
     266 * When viewing your Sentbox, last message is the most recent message in
     267 * the thread of which you *are* the member.
     268 *
     269 * @since BuddyPress (2.0.0)
     270 */
     271function bp_message_thread_content() {
     272        echo bp_get_message_thread_content();
     273}
     274        /**
     275         * Return the thread's last message content
     276         *
     277         * When viewing your Inbox, the last message is the most recent message in
     278         * the thread of which you are *not* the author.
     279         *
     280         * When viewing your Sentbox, last message is the most recent message in
     281         * the thread of which you *are* the member.
     282         *
     283         * @since BuddyPress (2.0.0)
     284         * @return string The raw content of the last message in the thread
     285         */
     286        function bp_get_message_thread_content() {
     287                global $messages_template;
     288
     289                return apply_filters( 'bp_get_message_thread_content', $messages_template->thread->last_message_content );
    258290        }
    259291
Note: See TracChangeset for help on using the changeset viewer.