存在get_all_post_type_supports()
获取给定帖子类型的支持功能。这是一个包装_wp_post_type_features
全局变量:
/**
* Get all the post type features
*
* @since 3.4.0
*
* @global array $_wp_post_type_features
*
* @param string $post_type The post type.
* @return array Post type supports list.
*/
function get_all_post_type_supports( $post_type ) {
global $_wp_post_type_features;
if ( isset( $_wp_post_type_features[$post_type] ) )
return $_wp_post_type_features[$post_type];
return array();
}
示例:这里有一个来自wp shell的
\'post\'
岗位类型:
wp> print_r( get_all_post_type_supports( \'post\' ) );
Array
(
[title] => 1
[editor] => 1
[author] => 1
[thumbnail] => 1
[excerpt] => 1
[trackbacks] => 1
[custom-fields] => 1
[comments] => 1
[revisions] => 1
[post-formats] => 1
)
另一个有用的包装是
get_post_types_by_support()
.