WP_Theme_JSON::maybe_opt_in_into_settings() – Enables some opt-in settings if theme declared support.

You appear to be a bot. Output may be restricted

Description

Enables some opt-in settings if theme declared support.

Usage

$array = WP_Theme_JSON::maybe_opt_in_into_settings( $theme_json );

Parameters

$theme_json
( array ) required – A theme.json structure to modify.

Returns

array The modified theme.json structure.

Source

File name: wordpress/wp-includes/class-wp-theme-json.php
Lines:

1 to 20 of 20
  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;
  }
 

 View on GitHub View on Trac