is_post_type_hierarchical

The timeline below displays how wordpress function is_post_type_hierarchical has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Determines whether the post type is hierarchical.
 *
 * A false return value might also mean that the post type does not exist.
 *
 * @since 3.0.0
 *
 * @see get_post_type_object()
 *
 * @param string $post_type Post type name
 * @return bool Whether post type is hierarchical.
 */
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;
}

WordPress Version: 4.0

/**
 * Whether the post type is hierarchical.
 *
 * A false return value might also mean that the post type does not exist.
 *
 * @since 3.0.0
 *
 * @see get_post_type_object()
 *
 * @param string $post_type Post type name
 * @return bool Whether post type is hierarchical.
 */
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;
}

WordPress Version: 3.7

/**
 * Whether the post type is hierarchical.
 *
 * A false return value might also mean that the post type does not exist.
 *
 * @since 3.0.0
 * @see get_post_type_object
 *
 * @param string $post_type Post type name
 * @return bool Whether post type is hierarchical.
 */
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;
}