函数原型
post_type_supports( string $post_type, string $feature ): bool
函数描述
Checks a post type’s support for a given feature.
是否弃用
未弃用
函数参数
-
$post_type
string
Required - The post type being checked.
-
$feature
string
Required - The feature being checked.
函数返回值
bool Whether the post type supports the given feature.
函数位置
File: wp-includes/post.php.
函数源码
function post_type_supports( $post_type, $feature ) {
global $_wp_post_type_features;
return ( isset( $_wp_post_type_features[ $post_type ][ $feature ] ) );
}
源码链接
变更日志
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |

