确定循环中当前帖子的发布日期是否与循环中上一篇文章的发布日期不同。
原型
is_new_day()
描述
有关此功能和类似主题功能的更多信息,请查看Theme Developer Handbook中的Conditional Tags文章。
返回值
(int)
1新的一天,0如果不是新的一天。
源文件
路径:wp-includes/functions.php
<?php
...
function is_new_day() {
global $currentday, $previousday;
if ( $currentday != $previousday )
return 1;
else
return 0;
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/is_new_day/