wpseek.com
Un motore di ricerca WordPress per sviluppatori e autori di temi



require_if_theme_supports › WordPress Function

Da2.9.0
Deprecaton/a
› require_if_theme_supports ( $feature, $file )
Parametri: (2)
  • (string) $feature The feature being checked. See add_theme_support() for the list of possible values.
    Richiesto: Sì
  • (string) $file Path to the file.
    Richiesto: Sì
Ritorna:
  • (bool) True if the active theme supports the supplied feature, false otherwise.
Definito a:
Codex:

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



Sorgenti

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