函数原型
is_post_type_hierarchical( string $post_type ): bool
函数描述
Determines whether the post type is hierarchical.
是否弃用
未弃用
函数参数
-
$post_type
string
Required - Post type name
函数返回值
bool Whether post type is hierarchical.
函数位置
File: wp-includes/post.php.
函数源码
function is_post_type_hierarchical( $post_type ) {
if ( ! post_type_exists( $post_type ) ) {
return false;
}
$post_type = get_post_type_object( $post_type );
return $post_type->hierarchical;
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

