get_registered_theme_feature() WordPress Function

The get_registered_theme_feature() function gives you a list of all the features that are currently registered for themes. This can be useful if you want to know what features are available for your theme, or if you want to register a new feature.

get_registered_theme_feature( string $feature ) #

Gets the registration config for a theme feature.


Parameters

$feature

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


Top ↑

Return

(array|null) The registration args, or null if the feature was not registered.


Top ↑

Source

File: wp-includes/theme.php

function get_registered_theme_feature( $feature ) {
	global $_wp_registered_theme_features;

	if ( ! is_array( $_wp_registered_theme_features ) ) {
		return null;
	}

	return isset( $_wp_registered_theme_features[ $feature ] ) ? $_wp_registered_theme_features[ $feature ] : null;
}

Top ↑

Changelog

Changelog
VersionDescription
5.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More