Search Results for 'bbp_get_time_since'
-
Search Results
Search for: ‘function bbp_get_time_since(‘
Anyone else interested, place this in your functions.php file:
function bbp_get_reply_last_active_time( $reply_id ) {
$last_active = get_post_field( 'post_date', $reply_id );
$last_active = !empty( $last_active ) ? bbp_get_time_since( bbp_convert_date( $last_active ) ) . ' ago' : '';
return $last_active;
}
and then call it in loop-single-reply.php
This was my solution
I edited line 178 in my /wp-content/plugins/bbpress/bbp-includes/bbp-common-functions.php
function bbp_get_time_since( $time ) {
return apply_filters( ‘bbp_get_time_since’, human_time_diff( $time – 25200, current_time( ‘timestamp’ ) ), $time );
}
In my case (Pacific Time) I needed to subtract 7 hours which translated to 25200 seconds.
@miruru – You could filter
bbp_get_topic_last_active
and output your own time, or you could hook into
bbp_get_time_since
and have it return the second parameter that’s passed to it.
See also: WordPress.org • bbPress.org • BuddyPress.org • Matt • Blog RSS