bbp_get_reply_post_date

Return the post date and time of a reply.

Description

(string) bbp_get_reply_post_date( (int) $reply_id = 0, (constant) $humanize = false, (bool) $gmt = false ); 

Returns (string)

Parameters (3)

0. $reply_id — Optional. (int)
Reply id.
1. $humanize — Optional. (constant) => false
Humanize output using time_since
2. $gmt — Optional. (bool) => false
Use GMT

Usage

  1. if ( !function_exists( 'bbp_get_reply_post_date' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/replies/template.php'; 
  3.  
  4. // Optional. Reply id. 
  5. $reply_id = -1; 
  6.  
  7. // Optional. Humanize output using time_since 
  8. $humanize = false; 
  9.  
  10. // Optional. Use GMT 
  11. $gmt = false; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = bbp_get_reply_post_date($reply_id, $humanize, $gmt); 
  15.  

Defined (1)

The function is defined in the following location(s).

/includes/replies/template.php  
  1. function bbp_get_reply_post_date( $reply_id = 0, $humanize = false, $gmt = false ) { 
  2. $reply_id = bbp_get_reply_id( $reply_id ); 
  3.  
  4. // 4 days, 4 hours ago 
  5. if ( !empty( $humanize ) ) { 
  6. $gmt_s = !empty( $gmt ) ? 'G' : 'U'; 
  7. $date = get_post_time( $gmt_s, $gmt, $reply_id ); 
  8. $time = false; // For filter below 
  9. $result = bbp_get_time_since( $date ); 
  10.  
  11. // August 4, 2012 at 2:37 pm 
  12. } else { 
  13. $date = get_post_time( get_option( 'date_format' ), $gmt, $reply_id, true ); 
  14. $time = get_post_time( get_option( 'time_format' ), $gmt, $reply_id, true ); 
  15. $result = sprintf( _x( '%1$s at %2$s', 'date at time', bbpress ), $date, $time ); 
  16.  
  17. return apply_filters( 'bbp_get_reply_post_date', $result, $reply_id, $humanize, $gmt, $date, $time );