如何修改(覆盖)评论(帖子和页面)的时间格式,而不涉及wordpress的初始安装?我使用一个子主题,如果可能的话,可以从子主题中执行,以防止我的更改被下一次WP更新覆盖。我更喜欢使用add\\u filter()
我正在尝试使用:
// 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);
但它只返回字符串“g:i:s”。WP 4.9.4