generateblocks
generateblocks copied to clipboard
Image Block - include medium large attachment size
Description
GB Image block has same behaviour as core block and omits the medium_large
attachment size.
It seems WP like to leave it out. But it can be added using this filter:
add_filter( 'image_size_names_choose', function() {
return [
'thumbnail' => __( 'Thumbnail', 'textdomain' ),
'medium' => __( 'Medium', 'textdomain' ),
'medium_large' => __( 'Medium Large', 'textdomain' ),
'large' => __( 'Large', 'textdomain' ),
'full' => __( 'Full Size', 'textdomain' ),
];
} );
Is it possible to make the GB image block list other sizes without using the filter ? Even if only the Medium Large is listed
@diggeddy currently, this is a limitation from core itself as they hard-coded the sizes. I'm pushing this for next version so we can implement our own solution.
https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/store/defaults.js#L132-L137