require_if_theme_supports( string $feature, string $file )
Checks a theme’s support for a given feature before loading the functions which implement it.
Parameters
- $feature
-
(Required) The feature being checked. See add_theme_support() for the list of possible values.
- $file
-
(Required) Path to the file.
Return
(bool) True if the active theme supports the supplied feature, false otherwise.
Source
File: wp-includes/theme.php
function require_if_theme_supports( $feature, $include ) {
if ( current_theme_supports( $feature ) ) {
require ( $include );
return true;
}
return false;
}
Changelog
Version | Description |
---|---|
2.9.0 | Introduced. |