get_post_types_by_support()
get_post_types_by_support( array|string $feature, string $operator = ‘and’ )
检索支持特定功能的post类型名称列表。
Retrieves a list of post type names that support a specific feature.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$feature | (array | string) | 必需 | post类型应支持的单个功能或功能数组。 |
$operator | (string) | 可选 | 要执行的逻辑操作或’表示数组中只有一个元素需要匹配;’和’表示所有元素都必须匹配;’不’表示任何元素都不能匹配。 |
返回(Return)
(string[])post类型名称的列表。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.5.0 | wp-includes/post.php:1933 | 0 | 1 function |
get_post_types_by_support() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_post_types_by_support/