post_type_supports()

检查post类型对给定功能的支持。

post_type_supports(string $post_type,string $feature)

参数(Parameters)

参数类型必填说明
$post_type(string)必需正在检查的邮件类型。
$feature(string)必需正在检查的功能。

返回(Return)

(bool)post类型是否支持给定的功能。


源码(Source)

/**
 * Check a post type's support for a given feature.
 *
 * @since 3.0.0
 *
 * @global array $_wp_post_type_features
 *
 * @param string $post_type The post type being checked.
 * @param string $feature   The feature being checked.
 * @return bool Whether the post type supports the given feature.
 */
function post_type_supports( $post_type, $feature ) {
	global $_wp_post_type_features;
	return ( isset( $_wp_post_type_features[$post_type][$feature] ) );
}
更新版本源码位置使用被使用
3.0.0wp-includes/post.php:1913330

笔记(Notes)

以转储所有可能的变量字符串。

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索