Using WordPress ‘get_registered_theme_feature()’ PHP function

The get_registered_theme_feature() WordPress PHP function gets the registration config for a theme feature.

Usage

To use the function, call get_registered_theme_feature( $feature ) where $feature is the name of the theme feature you want to get the config for.

Parameters

  • $feature (string) – Required. The feature name. See add_theme_support() for the list of possible values.

More information

See WordPress Developer Resources: get_registered_theme_feature()

Examples

Get ‘custom-logo’ feature config

This example retrieves the config for the ‘custom-logo’ feature.

$custom_logo_config = get_registered_theme_feature( 'custom-logo' );

Get ‘editor-color-palette’ feature config

This example retrieves the config for the ‘editor-color-palette’ feature.

$editor_color_palette_config = get_registered_theme_feature( 'editor-color-palette' );

Get ‘post-thumbnails’ feature config

This example retrieves the config for the ‘post-thumbnails’ feature.

$post_thumbnails_config = get_registered_theme_feature( 'post-thumbnails' );

Get ‘responsive-embeds’ feature config

This example retrieves the config for the ‘responsive-embeds’ feature.

$responsive_embeds_config = get_registered_theme_feature( 'responsive-embeds' );

Get ‘custom-header’ feature config

This example retrieves the config for the ‘custom-header’ feature.

$custom_header_config = get_registered_theme_feature( 'custom-header' );