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