Gutenberg,  Uncategorized,  WordPress

Using custom image sizes in WordPress Gutenberg MediaUpload component

add_filter( 'image_size_names_choose', 'my_custom_sizes' );
 
function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
        'gallery-thumb' => __( 'Gallery Thumb' ),
        'medium-square' => __( 'Medium Square' )
    ) );
}

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.