Skip to:
Content

BuddyPress.org

Changeset 8674


Ignore:
Timestamp:
07/23/2014 04:56:57 PM (5 years ago)
Author:
johnjamesjacoby
Message:

Introduce Messages functions for getting and outputting the sender ID of a message in a single thread.

File:
1 edited

Legend:

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

    r8617 r8674  
    15731573
    15741574/**
     1575 * Output the ID for message sender within a single thread
     1576 *
     1577 * @since BuddyPress (2.1.0)
     1578 */
     1579function bp_the_thread_message_sender_id() {
     1580    echo bp_get_the_thread_message_sender_id();
     1581}
     1582    /**
     1583     * Return the ID for message sender within a single thread
     1584     *
     1585     * @since BuddyPress (2.1.0)
     1586     *
     1587     * @return string
     1588     */
     1589    function bp_get_the_thread_message_sender_id() {
     1590        global $thread_template;
     1591
     1592        $user_id = ! empty( $thread_template->message->sender_id )
     1593            ? $thread_template->message->sender_id
     1594            : 0;
     1595
     1596        return (int) apply_filters( 'bp_get_the_thread_message_css_class', (int) $user_id );
     1597    }
     1598
     1599/**
    15751600 * Output the avatar for the current message sender.
    15761601 *
Note: See TracChangeset for help on using the changeset viewer.