require_if_theme_supports()
Checks a theme's support for a given feature before loading the functions which implement it.
Хуков нет.
Возвращает
bool. True if the active theme supports the supplied feature, false otherwise.
Использование
require_if_theme_supports( $feature, $file );
- $feature(строка) (обязательный)
- The feature being checked. See add_theme_support() for the list of possible values.
- $file(строка) (обязательный)
- Path to the file.
Список изменений
| С версии 2.9.0 | Введена. |
Код require_if_theme_supports() require if theme supports WP 7.1.2
function require_if_theme_supports( $feature, $file ) {
if ( current_theme_supports( $feature ) ) {
require $file;
return true;
}
return false;
}