A WordPress-centric search engine for devs and theme authors



post_type_exists ›

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

Check if a post type is registered.



Source

function post_type_exists( $post_type ) {
	return (bool) get_post_type_object( $post_type );
}