Skip to:
Content

BuddyPress.org

Changeset 7329


Ignore:
Timestamp:
07/31/2013 01:24:36 PM (11 years ago)
Author:
boonebgorges
Message:

Introduces bp_get_the_thread_message_id()

This convenience function makes it easier to access the numeric ID of the
current message in the thread.

Fixes #5123

Props dtc7240

File:
1 edited

Legend:

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

    r7228 r7329  
    851851    }
    852852
     853/**
     854 * Echoes the ID of the current message in the thread
     855 *
     856 * @since BuddyPress (1.9)
     857 */
     858function bp_the_thread_message_id() {
     859    echo bp_get_the_thread_message_id();
     860}
     861    /**
     862     * Gets the ID of the current message in the thread
     863     *
     864     * @since BuddyPress (1.9)
     865     * @return int
     866     */
     867    function bp_get_the_thread_message_id() {
     868        global $thread_template;
     869
     870        $thread_message_id = isset( $thread_template->message->id ) ? (int) $thread_template->message->id : null;
     871        return apply_filters( 'bp_get_the_thread_message_id', $thread_message_id );
     872    }
     873
    853874function bp_the_thread_message_alt_class() {
    854875    echo bp_get_the_thread_message_alt_class();
Note: See TracChangeset for help on using the changeset viewer.