Wordpress image size select not showing in Gutenberg image block controls

325 Views Asked by At

I'm trying to insert an image into a post from the media library, but there is no select size option in the media library when selecting an image to choose which size to insert, and the 'Image size' control is not shown in the block editor image block controls.

The image thumbnails are definitely created.

I'm using a custom theme, and I have this in the functions.php:

add_action('after_setup_theme', 'my_theme_setup');

function my_theme_setup() {
     if ( function_exists( 'add_theme_support' ) ) {
         add_theme_support( 'post-thumbnails' );
         add_image_size( 'original', '', '', true );
         add_image_size( 'large', 700, '', true );
     }
}

add_filter( 'image_size_names_choose', 'my_custom_sizes' );
 
function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
        'original'  => 'Original',
        'large'     => 'Large'
    ));
}
0

There are 0 best solutions below