时间:2024-03-12
WordPress函数get_post_status用于获取文章的状态,比较少用到。
get_post_status( int $ID )
$ID
整数型,默认为空
文章的ID
publish:公开的;
pending:待审核;
draft:草稿;
auto-draft:自动草稿;
future:定时;
private:私有的;
inherit:继承,子页面继承父级页面属性;
trash:垃圾箱;
<?php if ( get_post_status ( 28 ) == 'private' ) { echo 'private'; } else { echo 'public'; } ?>
get_post_status()函数位于:wp-includes/post.php
相关函数:
get_post_statuses()
Copyright © 2019-2024 javascript.hk