wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



post_type_exists › WordPress Function

Od3.0.0
Przestarzałyn/a
› post_type_exists ( $post_type )
Parametry:
  • (string) $post_type Post type name.
    Wymagane: Tak
Zobacz:
Powrót:
  • (bool) Whether post type is registered.
Zdefiniowane na:
Codex:

Determines whether a post type is registered.

For more information on this and similar theme functions, check out the {@link https://developer.wordpress.org/themes/basics/conditional-tags/} article in the Theme Developer Handbook.


Źródło

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