wpseek.com
WordPress开发者和主题制作者的搜索引擎



get_post_types_by_support › WordPress Function

Since4.5.0
已弃用n/a
get_post_types_by_support ( $feature, $operator = 'and' )
参数: (2)
  • (array|string) $feature Single feature or an array of features the post types should support.
    Required: Yes
  • (string) $operator 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 'and'.
    Required: No
    默认: 'and'
返回:
  • (string[]) A list of post type names.
定义在:
文档:

Retrieves a list of post type names that support a specific feature.



源码

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 ) );
}