get_post_types_by_support( array|string $feature, string $operator = 'and' )
Retrieves a list of post type names that support a specific feature.
描述
参数
- $feature
-
(array|string)
(Required)
Single feature or an array of features the post types should support. - $operator
-
(string)
(Optional)
The logical operation to perform. 'or' means only one element from the array needs to match; 'and' means all elements must match; 'not' means no elements may match.Default value: 'and'
返回值
(array) A list of post type names.
源代码
File: wp-includes/post.php
function get_post_types_by_support( $feature, $operator = 'and' ) {
global $_wp_post_type_features;
$features = array_fill_keys( (array) $feature, true );
return array_keys( wp_filter_object_list( $_wp_post_type_features, $features, $operator ) );
}
更新日志
Version | 描述 |
---|---|
4.5.0 | Introduced. |
相关函数
Uses
-
wp-includes/functions.php:
wp_filter_object_list()
你可能对这些文章感兴趣:
- wordpress函数has_filter()用法示例
- wordpress函数has_meta()用法示例
- wordpress函数has_excerpt()用法示例
- wordpress函数has_header_video()用法示例
- wordpress函数has_custom_logo()用法示例
- wordpress函数has_category()用法示例
- wordpress函数has_custom_header()用法示例
- wordpress函数hash_hmac()用法示例
- wordpress函数grant_super_admin()用法示例
- wordpress函数get_the_post_thumbnail_url()用法示例
- wordpress函数hash_equals()用法示例
- wordpress函数got_url_rewrite()用法示例
- wordpress函数gzip_compression()用法示例
- wordpress函数got_mod_rewrite()用法示例
如有疑问,请前往问答中心反馈!
反馈