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.

Return

true/false. Whether post type is hierarchical.

Usage

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

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

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

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