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
Parameters
- $feature
-
(string) (Required) The feature being checked.
- $include
-
(string) (Required) Path to the file.
Return
(bool) True if the current 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. |