wpseek.com
Bazujące na WordPress narzędzie wyszukiwania dla deweloperów i twórców motywów.



require_if_theme_supports › WordPress Function

Od2.9.0
Przestarzałyn/a
require_if_theme_supports ( $feature, $file )
Parametry: (2)
  • (string) $feature The feature being checked. See add_theme_support() for the list of possible values.
    Wymagane: Tak
  • (string) $file Path to the file.
    Wymagane: Tak
Powrót:
  • (bool) True if the active theme supports the supplied feature, false otherwise.
Zdefiniowane na:
Codex:

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



Źródło

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