• Resolved dvpfig

    (@dvpfig)


    Hi,

    I have limited storage space with my web hosting provider, so I need to limit the number of copies of each image uploaded.
    The Atomic Blocks plugin creates 2 additional customized image sizes (600×660 and 600×400) that are only used in the block POST GRID.

    Since I am not using that particular block, I would like to either have a selector for the block, a selector to skip creating these 2 additional image sizes, or a hook to edit plugin code.
    Is any of this planned? Or can it be added with low effort? The block “post grid” will still be usable but with the wordpress generated image sizes.

    The current hack that I have to avoid these 2 unnecessary image sizes is to edit the plugin directly and comment out the line “add_action( ‘after_setup_theme’, ‘atomic_blocks_image_sizes’ );” in the block below.
    However, this is not a nice solution as it gets erased with every plugin update.

    —————————————————–
    /**
    * Add image sizes
    */
    function atomic_blocks_image_sizes() {
    // Post Grid Block.
    add_image_size( ‘ab-block-post-grid-landscape’, 600, 400, true );
    add_image_size( ‘ab-block-post-grid-square’, 600, 600, true );
    }
    add_action( ‘after_setup_theme’, ‘atomic_blocks_image_sizes’ );
    —————————————————–

    Thanks in advance for the support. The plugin is really great and I love the block NOTICE.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author atomicblocks

    (@atomicblocks)

    Hi there,

    Sorry for the delayed response, but this is a good idea to include a filter for this. I’ve added it to our Github issues as an enhancement, and we’ll take a look at adding that soon. Thanks again!

    Plugin Author John Parris

    (@mindctrl)

    @dvpfig,

    I have a more permanent solution for you so that you don’t have to keep editing the plugin’s files to remove the custom image size.

    Add the following code snippet to your site to remove the image sizes registered by Atomic Blocks. If you’re not familiar with how to add code snippet to your site, we recommend using Pluginception to create a custom plugin, paste in the code, and activate your new plugin.

    Here’s the code you need.

    
    add_action( 'after_setup_theme', function () {
    	remove_image_size( 'ab-block-post-grid-landscape' );
    	remove_image_size( 'ab-block-post-grid-square' );
    }, 11 );
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Turn on/off addition of custom image sizes’ is closed to new replies.