Allows a theme to de-register its support of a certain feature
Should be called in the theme’s functions.php file. Generally would be used for child themes to override support from the parent theme.
$featurestringrequired
'admin-bar''align-wide''appearance-tools''automatic-feed-links''block-templates''block-template-parts''border''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''disable-custom-gradients''disable-layout-styles''editor-color-palette''editor-gradient-presets''editor-font-sizes''editor-spacing-sizes''editor-styles''featured-content''html5''link-color''menus''post-formats''post-thumbnails''responsive-embeds''starter-content''title-tag''widgets''widgets-block-editor''wp-block-styles'function remove_theme_support( $feature ) {
// Do not remove internal registrations that are not used directly by themes.
if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ), true ) ) {
return false;
}
return _remove_theme_support( $feature );
}
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/remove_theme_support