wpseek.com
A WordPress-centric search engine for devs and theme authors



post_type_exists › WordPress Function

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:

Determines whether a post type is registered.

For more information on this and similar theme functions, check out the {@link Conditional Tags} article in the Theme Developer Handbook.


Source

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