函数原型
get_theme_support( string $feature, mixed $args ): mixed
函数描述
Gets the theme support arguments passed when registering that support.
是否弃用
未弃用
函数参数
-
$feature
string
Required - The feature to check. 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.
函数返回值
mixed The array of extra arguments or the value for the registered feature.
函数位置
File: wp-includes/theme.php.
函数源码
get_theme_support( 'custom-logo' );
get_theme_support( 'custom-header', 'width' );源码链接
变更日志
| Version | Description |
|---|---|
| 5.3.0 | Formalized the existing and already documented ...$args parameter by adding it to the function signature. |
| 3.1.0 | Introduced. |

