WP_Theme_JSON::maybe_opt_in_into_settings( array $theme_json ): array
Enables some opt-in settings if theme declared support.
Parameters
-
$theme_json
array Required -
A theme.json structure to modify.
Return
array The modified theme.json structure.
Source
File: wp-includes/class-wp-theme-json.php
.
View all references
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;
}
Changelog
Version | Description |
---|---|
5.9.0 | Introduced. |