How to amend (override) the time format of the comments (of the posts and pages), not touching the wordpress initial installation? I use a child theme and if it is possible in any way to do it from the child theme to prevent my changes been overwritten by the next WP update. I would prefer to use add_filter()
I am trying to use:
// define the get_comment_time callback
function filter_get_comment_time( $date, $d, $gmt, $translate, $comment ) {
$d = "g:i:s";
return $d;
};
// add the filter
add_filter( 'get_comment_time', 'filter_get_comment_time', 10, 5);
But it returns only the string "g:i:s".
WP 4.9.4