• Resolved zzlatevv

    (@zzlatevv)


    Hi guys,

    I’m using the following function to remove the unwanted images sizes. But when I activate it, your plugin stops working.

    Can you please advice?

    /*
    * WordPress: Remove unwonted image sizes.
    * In this code I remove the three sizes medium_large, 1536x1536, 2048x2048
    * See full article:
    */

    add_filter('intermediate_image_sizes', function($sizes) {
    return array_diff($sizes, ['medium_large']); // Medium Large (768 x 0)
    });

    add_action( 'init', 'j0e_remove_large_image_sizes' );
    function j0e_remove_large_image_sizes() {
    remove_image_size( '1536x1536' ); // 2 x Medium Large (1536 x 1536)
    remove_image_size( '2048x2048' ); // 2 x Large (2048 x 2048)
    }

    There are a few errors in the console.

    TypeError: Invalid attempt to spread non-iterable instance.
    In order to be iterable, non-array objects must have a [Symbol.iterator]() method.
    Fn https:///elementor/wp-content/plugins/wp-retina-2x/app/index.js?ver=1715004649:2
    Fn https:///elementor/wp-content/plugins/wp-retina-2x/app/index.js?ver=1715004649:2
    Be https:///elementor/wp-content/plugins/wp-retina-2x/app/index.js?ver=1715004649:2
    useMemo https:///elementor/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10
    useMemo https:///elementor/wp-includes/js/dist/vendor/react.min.js?ver=18.2.0:10
    nr https:///elementor/wp-content/plugins/wp-retina-2x/app/index.js?ver=1715004649:2
    wt https:///elementor/wp-includes/js/dist/vendor/react-dom.min.js?ver=18.2.0:10
Viewing 1 replies (of 1 total)
  • Plugin Support Val Meow

    (@valwa)

    Hey @zzlatevv! ??

    If you want to use the plugin, please refrain from using this filter and handle the sizes directly in the plugin’s dashboard instead. This will prevent both snippets from executing and potentially causing issues. Thanks!

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.