wpseek.com
WordPress开发者和主题制作者的搜索引擎



is_post_type_hierarchical › WordPress Function

Since3.0.0
已弃用n/a
is_post_type_hierarchical ( $post_type )
参数:
  • (string) $post_type Post type name
    Required: Yes
查看:
返回:
  • (bool) Whether post type is hierarchical.
定义在:
文档:

Determines whether the post type is hierarchical.

A false return value might also mean that the post type does not exist.


源码

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;
}