Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



require_if_theme_supports ›

Seit2.9.0
Veraltetn/v
require_if_theme_supports ( $feature, $include )
Parameter: (2)
  • (string) $feature The feature being checked.
    Erforderlich: Ja
  • (string) $include Path to the file.
    Erforderlich: Ja
Gibt zurück:
  • (bool) True if the current theme supports the supplied feature, false otherwise.
Definiert in:
Codex:

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



Quellcode

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