WP_Theme_JSON::maybe_opt_in_into_settings
Enables some opt-in settings if theme declared support.
Метод класса: WP_Theme_JSON{}
Хуков нет.
Возвращает
Массив. The modified theme.json structure.
Использование
$result = WP_Theme_JSON::maybe_opt_in_into_settings( $theme_json );
- $theme_json(массив) (обязательный)
- A theme.json structure to modify.
Список изменений
| С версии 5.9.0 | Введена. |
Код WP_Theme_JSON::maybe_opt_in_into_settings() WP Theme JSON::maybe opt in into settings WP 7.0
protected static function maybe_opt_in_into_settings( $theme_json ) {
$new_theme_json = $theme_json;
if (
isset( $new_theme_json['settings']['appearanceTools'] ) &&
true === $new_theme_json['settings']['appearanceTools']
) {
static::do_opt_in_into_settings( $new_theme_json['settings'] );
}
if ( isset( $new_theme_json['settings']['blocks'] ) && is_array( $new_theme_json['settings']['blocks'] ) ) {
foreach ( $new_theme_json['settings']['blocks'] as &$block ) {
if ( isset( $block['appearanceTools'] ) && ( true === $block['appearanceTools'] ) ) {
static::do_opt_in_into_settings( $block );
}
}
}
return $new_theme_json;
}