WP_Theme_JSON::maybe_opt_in_into_settings()
Enables some opt-in settings if theme declared support.
Method of the class: WP_Theme_JSON{}
No Hooks.
Return
Array
. The modified theme.json structure.
Usage
$result = WP_Theme_JSON::maybe_opt_in_into_settings( $theme_json );
- $theme_json(array) (required)
- A theme.json structure to modify.
Changelog
Since 5.9.0 | Introduced. |
WP_Theme_JSON::maybe_opt_in_into_settings() WP Theme JSON::maybe opt in into settings code WP 6.6.2
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; }