Make WordPress Core

Changeset 50570 for trunk


Ignore:
Timestamp:
03/24/2021 07:31:37 AM (4 years ago)
Author:
gziolo
Message:

Editor: Add image default size to block editor settings

Related: https://github.com/WordPress/gutenberg/pull/29966

Add new imageDefaultSize value to block editor settings.

Props Mamaduka.
Fixes #52896.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-blocks.php

    r50295 r50570  
    251251}
    252252
     253$default_size       = get_option( 'image_default_size', 'large' );
     254$image_default_size = in_array( $default_size, array_keys( $image_size_names ), true ) ? $image_default_size : 'large';
     255
    253256$image_dimensions = array();
    254257$all_sizes        = wp_get_registered_image_subsizes();
     
    324327    'defaultEditorStyles'                  => $default_editor_styles,
    325328    'imageSizes'                           => $available_image_sizes,
     329    'imageDefaultSize'                     => $image_default_size,
    326330    'imageDimensions'                      => $image_dimensions,
    327331    'richEditingEnabled'                   => user_can_richedit(),
Note: See TracChangeset for help on using the changeset viewer.