is_post_type_hierarchical() WordPress Function

The is_post_type_hierarchical() function is used to check whether a post type is hierarchical.

is_post_type_hierarchical( string $post_type ) #

Whether the post type is hierarchical.


Description

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

Top ↑

See also


Top ↑

Parameters

$post_type

(string)(Required)Post type name


Top ↑

Return

(bool) Whether post type is hierarchical.


Top ↑

Source

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


Top ↑

Changelog

Changelog
VersionDescription
3.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More