Uma área de pesquisa sobre o WordPress para devs e autores do tema



require_if_theme_supports ›

Desde2.9.0
Obsoleton/a
require_if_theme_supports ( $feature, $include )
Parâmetros: (2)
  • (string) $feature The feature being checked.
    Required: Yes
  • (string) $include Path to the file.
    Required: Yes
Retorna:
  • (bool) True if the current theme supports the supplied feature, false otherwise.
Definido em:
Codex:

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



Fonte

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