bbp_get_reply_post_date( int $reply_id, bool $humanize = false, bool $gmt = false )

Return the post date and time of a reply

Description

Parameters

$reply_id

(Optional) Reply id.

$humanize

(Optional) Humanize output using time_since

Default value: false

$gmt

(Optional) Use GMT

Default value: false

Return

(string)

Source

File: bp-forums/replies/template.php

711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
function bbp_get_reply_post_date( $reply_id = 0, $humanize = false, $gmt = false ) {
    $reply_id = bbp_get_reply_id( $reply_id );
 
    // 4 days, 4 hours ago
    if ( !empty( $humanize ) ) {
        $gmt_s  = !empty( $gmt ) ? 'G' : 'U';
        $date   = get_post_time( $gmt_s, $gmt, $reply_id );
        $time   = false; // For filter below
        $result = bbp_get_time_since( $date );
 
    // August 4, 2012 at 2:37 pm
    } else {
        $date   = get_post_time( get_option( 'date_format' ), $gmt, $reply_id, true );
        $time   = get_post_time( get_option( 'time_format' ), $gmt, $reply_id, true );
        $result = sprintf( _x( '%1$s at %2$s', 'date at time', 'buddyboss' ), $date, $time );
    }
 
    return apply_filters( 'bbp_get_reply_post_date', $result, $reply_id, $humanize, $gmt, $date, $time );
}

Changelog

Changelog
Version Description
bbPress (r4155) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.