Outil de recherche WordPress pour les développeurs et auteurs de thèmes



require_if_theme_supports ›

Depuis2.9.0
Dépréciéen/a
require_if_theme_supports ( $feature, $include )
Paramètres: (2)
  • (string) $feature The feature being checked.
    Requis: Oui
  • (string) $include Path to the file.
    Requis: Oui
Retourne:
  • (bool) True if the current theme supports the supplied feature, false otherwise.
Défini(e) dans:
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;
}