Last active
December 30, 2015 03:09
-
-
Save ntwb/7767761 to your computer and use it in GitHub Desktop.
bbPress - Enable date/time translation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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