我想将时间前的日期格式从5分钟设置为5分钟。我可以编辑格式。php文件并进行编辑,但我应该吗?我应该在函数中声明编辑吗。php文件?
From the formatting.php file:
function human_time_diff( $from, $to = \'\' ) {
if ( empty( $to ) ) {
$to = time();
}
$diff = (int) abs( $to - $from );
if ( $diff < HOUR_IN_SECONDS ) {
$mins = round( $diff / MINUTE_IN_SECONDS );
if ( $mins <= 1 )
$mins = 1;
/* translators: Time difference between two dates, in minutes (min=minute). 1: Number of minutes */
$since = sprintf( _n( \'%s min\', \'%s min\', $mins ), $mins );
}
正如您上次所看到的,我可以将\'\'%1!\'\'更改为\'\'%2!\'\',这就完成了。如果WordPress不鼓励编辑格式。php文件,如何在函数中进行此编辑。php?