post_type_exists( string $post_type ): bool
Determines whether a post type is registered.
Contents
Description
For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.
See also
Parameters
-
$post_type
string Required -
Post type name.
Return
bool Whether post type is registered.
Source
File: wp-includes/post.php
.
View all references
function post_type_exists( $post_type ) {
return (bool) get_post_type_object( $post_type );
}
Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Basic Examples