Skip to content

Instantly share code, notes, and snippets.

@termitkin
Created September 16, 2019 14:25
Show Gist options
  • Save termitkin/c96e17a681dcf97751553f96ff2c17e5 to your computer and use it in GitHub Desktop.
Save termitkin/c96e17a681dcf97751553f96ff2c17e5 to your computer and use it in GitHub Desktop.
[WordPress] Comment date to format %count_days% ago
function pressfore_comment_time_output($date, $d, $comment){
return sprintf( _x('%s ago', '%s = human-readable time difference'), human_time_diff(get_comment_time('U'), current_time('timestamp')));
}
add_filter('get_comment_date', 'pressfore_comment_time_output', 10, 3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment