post_type_exists()
post_type_exists( string $post_type ) 确定是否注册邮件类型。Determ…
post_type_exists( string $post_type )
确定是否注册邮件类型。
Determines whether a post type is registered.
确定是否注册邮件类型。
Determines whether a post type is registered.
目录锚点:#说明#参数#返回#源码#笔记
说明(Description)
另见函数 get_post_type_object()
参数(Parameters)
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| $post_type | (string) | 必需 | 文章类型名称。 |
返回(Return)
(bool)post类型是否已注册。
源码(Source)
/**
* Check if a post type is registered.
*
* @since 3.0.0
*
* @see get_post_type_object()
*
* @param string $post_type Post type name.
* @return bool Whether post type is registered.
*/
function post_type_exists( $post_type ) {
return (bool) get_post_type_object( $post_type );
}| 更新版本 | 源码位置 | 使用 | 被使用 |
|---|---|---|---|
| 3.0.0 | wp-includes/post.php:1203 | 11 | 1 function |
笔记(Notes)
基本示例
类别:WordPress 函数手册、
本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

还没有任何评论,赶紧来占个楼吧!