get_classic_theme_supports_block_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.
'blockCategories'                  => get_default_block_categories(),
        'isRTL'                            => is_rtl(),
        'imageDefaultSize'                 => $image_default_size,
        'imageDimensions'                  => $image_dimensions,
        'imageEditing'                     => true,
        'imageSizes'                       => $available_image_sizes,
        'maxUploadFileSize'                => $max_upload_size,
        // The following flag is required to enable the new Gallery block format on the mobile apps in 5.9.         '__unstableGalleryWithImageBlocks' => true,
    );

    $theme_settings = get_classic_theme_supports_block_editor_settings();
    foreach ( $theme_settings as $key => $value ) {
        $editor_settings[ $key ] = $value;
    }

    return $editor_settings;
}

/** * Returns the block editor settings needed to use the Legacy Widget block which * is not registered by default. * * @since 5.8.0 * * @return array Settings to be used with get_block_editor_settings(). */
Home | Imprint | This part of the site doesn't use cookies.