函数原型
current_theme_supports( string $feature, mixed $args ): bool
函数描述
Checks a theme’s support for a given feature.
是否弃用
未弃用
函数参数
-
$feature
string
Required - The feature being checked. See add_theme_support() for the list of possible values.
More Arguments from add_theme_support( … $feature )
The feature being added. Likely core values include:
'admin-bar''align-wide''automatic-feed-links''core-block-patterns''custom-background''custom-header''custom-line-height''custom-logo''customize-selective-refresh-widgets''custom-spacing''custom-units''dark-editor-style''disable-custom-colors''disable-custom-font-sizes''editor-color-palette''editor-gradient-presets''editor-font-sizes''editor-styles''featured-content''html5''menus''post-formats''post-thumbnails''responsive-embeds''starter-content''title-tag''wp-block-styles''widgets''widgets-block-editor'
-
$args
mixed
Optional - extra arguments to be checked against certain features.
函数返回值
bool True if the active theme supports the feature, false otherwise.
函数位置
File: wp-includes/theme.php.
函数源码
current_theme_supports( 'custom-logo' );
current_theme_supports( 'html5', 'comment-form' );源码链接
变更日志
| Version | Description |
|---|---|
| 5.3.0 | Formalized the existing and already documented ...$args parameter by adding it to the function signature. |
| 2.9.0 | Introduced. |

