php – WordPress – 检查帖子是否有更新
作者:互联网
如何在Wordpress中检查帖子是否已更新?
if (post_has_edit())
the_modified_time();
else
the_time();
有没有像post_has_edit()这样的函数?
解决方法:
If the post or page is not yet modified, the modified time is the same as the creation time.
所以你可以使用the_modified_time(),如果帖子没有被修改,它将返回创建时间.
要检查帖子是否已被修改,请检查the_modified_time()== the_time().
标签:php,wordpress,last-modified 来源: https://codeday.me/bug/20190824/1708955.html