Skip to content

Instantly share code, notes, and snippets.

@ntwb
Last active December 30, 2015 03:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntwb/7767761 to your computer and use it in GitHub Desktop.
Save ntwb/7767761 to your computer and use it in GitHub Desktop.
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