您可以执行以下操作:
echo str_replace(\'mins\', \'minutes\', human_time_diff( get_the_time(\'U\'), current_time(\'timestamp\') ) . \' ago\');
Update:
建议使用相同的过滤器:
add_filter(\'human_time_diff\', \'new_human_time_diff\', 10, 2);
function new_human_time_diff($from, $to) {
// remove filter to prevent the loop
remove_filter(\'human_time_diff\', \'new_human_time_diff\');
$timediff = str_replace(\'mins\', \'minutes\', human_time_diff($from, $to) . \' ago\');
// restore the filter
add_filter( \'human_time_diff\', \'new_human_time_diff\', 10, 2);
return $timediff;
}
echo human_time_diff(get_the_time(\'U\'), current_time(\'timestamp\'));