get_from_editor_settings example

if ( ! $options['with_supports'] ) {
            return static::$theme;
        }

        /* * We want the presets and settings declared in theme.json * to override the ones declared via theme supports. * So we take theme supports, transform it to theme.json shape * and merge the static::$theme upon that. */
        $theme_support_data = WP_Theme_JSON::get_from_editor_settings( get_classic_theme_supports_block_editor_settings() );
        if ( ! wp_theme_has_theme_json() ) {
            if ( ! isset( $theme_support_data['settings']['color'] ) ) {
                $theme_support_data['settings']['color'] = array();
            }

            $default_palette = false;
            if ( current_theme_supports( 'default-color-palette' ) ) {
                $default_palette = true;
            }
            if ( ! isset( $theme_support_data['settings']['color']['palette'] ) ) {
                // If the theme does not have any palette, we still want to show the core one.
Home | Imprint | This part of the site doesn't use cookies.