Skip to:
Content

Changeset 8793


Ignore:
Timestamp:
08/11/2014 05:14:33 PM (4 years ago)
Author:
johnjamesjacoby
Message:

Introduce _raw() functions for last post date in a private message thread, making it easier for custom themes to use this data.

File:
1 edited

Legend:

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

    r8792 r8793  
    607607
    608608/**
    609  * Output the date of the last post in the current thread.
     609 * Output the unformatted date of the last post in the current thread.
     610 */
     611function bp_message_thread_last_post_date_raw() {
     612    echo bp_get_message_thread_last_post_date_raw();
     613}
     614    /**
     615     * Get the unformatted date of the last post in the current thread.
     616     *
     617     * @return string
     618     */
     619    function bp_get_message_thread_last_post_date_raw() {
     620        global $messages_template;
     621
     622        return apply_filters( 'bp_get_message_thread_last_message_date', $messages_template->thread->last_message_date );
     623    }
     624
     625/**
     626 * Output the nicely formatted date of the last post in the current thread.
    610627 */
    611628function bp_message_thread_last_post_date() {
     
    613630}
    614631    /**
    615      * Get the date of the last post in the current thread.
     632     * Get the nicely formatted date of the last post in the current thread.
    616633     *
    617634     * @return string
    618635     */
    619636    function bp_get_message_thread_last_post_date() {
    620         global $messages_template;
    621 
    622         return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( $messages_template->thread->last_message_date ) ) );
     637        return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( bp_get_message_thread_last_post_date_raw() ) ) );
    623638    }
    624639
Note: See TracChangeset for help on using the changeset viewer.