A WordPress-centric search engine for devs and theme authors



is_post_type_hierarchical ›

Since3.0.0
Deprecatedn/a
is_post_type_hierarchical ( $post_type )
Parameters:
  • (string) $post_type Post type name
    Required: Yes
See:
Returns:
  • (bool) Whether post type is hierarchical.
Defined at:
Codex:

Whether the post type is hierarchical.

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



Source

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