| | 664 | * Whether the post type is hierarchical. |
| | 665 | * |
| | 666 | * A false return value might also mean that the post type does not exist. |
| | 667 | * |
| | 668 | * @since 3.0.0 |
| | 669 | * @see get_post_type_object |
| | 670 | * |
| | 671 | * @param string|int|object $post Post type name, post id, or a post object. |
| | 672 | * @return bool true if post type is hierarchical, else false. |
| | 673 | */ |
| | 674 | function is_post_type_hierarchical( $post = false ) { |
| | 675 | if ( $is_post_type = get_post_type_object($post) ) |
| | 676 | return $is_post_type->hierarchical; |
| | 677 | |
| | 678 | $ptype = get_post( $post, OBJECT ); |
| | 679 | if ( $is_post_type = get_post_type_object($ptype->post_type) ) |
| | 680 | return $is_post_type->hierarchical; |
| | 681 | |
| | 682 | return false; |
| | 683 | } |
| | 684 | |
| | 685 | /** |