WordPress at a glance

is_post_type_hierarchical() WP 1.0

Whether the post type is hierarchical.

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

  • See: get_post_type_object()
✈ 1 time = 0.000011s = very fast | 50000 times = 0.03s = speed of light PHP 7.0.2, WP 4.4.2

No Hooks.


true/false. Whether post type is hierarchical.


is_post_type_hierarchical( $post_type );
$post_type(string) (required)
Post type name

Code of is_post_type_hierarchical: wp-includes/post.php VER 5.0.1

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;

Related Functions

From tag: Custom post type (post_type)

More from tag: Conditional tags (all)

More from category: Custom Types

No comments
    Hello, !     Log In . Register