Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
bbPress - Enable date/time translation
<?php
/*
Plugin Name: bbPress - Enable date/time translation
Plugin URI: https://gist.github.com/ntwb/7767761
Description: bbPress - Enable date/time translation
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
add_filter ( 'bbp_get_reply_post_date', ntwb_bbpress_enable_date_translation, 10, 6);
add_filter ( 'bbp_get_topic_post_date', ntwb_bbpress_enable_date_translation, 10, 6);
function ntwb_bbpress_enable_date_translation( $result, $reply_id, $humanize, $gmt, $date, $time ) {
$date = get_post_time( get_option( 'date_format' ), $gmt, $reply_id, $translate = true );
$result = sprintf( _x( '%1$s at %2$s', 'date at time', 'bbpress' ), $date, $time );
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment