post_type_exists()

最后更新于:2021-11-27 19:45:32

post_type_exists( string$post_type)

Determines whether a post type is registered.

参数

$post_type

(string) (Required) Post type name.

响应

(bool) Whether post type is registered.

源文件

文件: gc-includes/post.php

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