A WordPress-centric search engine for devs and theme authors



require_if_theme_supports ›

Since2.9.0
Deprecatedn/a
require_if_theme_supports ( $feature, $include )
Parameters: (2)
  • (string) $feature The feature being checked.
    Required: Yes
  • (string) $include Path to the file.
    Required: Yes
Returns:
  • (bool) True if the current theme supports the supplied feature, false otherwise.
Defined at:
Codex:

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



Source

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