wpseek.com
Outil de recherche WordPress pour les développeurs et auteurs de thèmes



post_type_exists › WordPress Function

Depuis3.0.0
Dépréciéen/a
post_type_exists ( $post_type )
Paramètres:
  • (string) $post_type Post type name.
    Requis: Oui
Voir:
Retourne:
  • (bool) Whether post type is registered.
Défini(e) dans:
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 );
}