require_if_theme_supports( string $feature, string $include )

Checks a theme’s support for a given feature before loading the functions which implement it.


Description Description


Parameters Parameters

$feature

(string) (Required) The feature being checked.

$include

(string) (Required) Path to the file.


Top ↑

Return Return

(bool) True if the current theme supports the supplied feature, false otherwise.


Top ↑

Source Source

File: wp-includes/theme.php

function require_if_theme_supports( $feature, $include ) {
	if ( current_theme_supports( $feature ) ) {
		require( $include );
		return true;
	}
	return false;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.9.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.