• Resolved cybmeta

    (@cybmeta)


    Hi!! I was removing rocket_lazyload_images filter and adding it again on my own because some specific needs, but since version 2.0 it doesn’t work anymore. Which alternative can I use in the new version?

    Example of what I was doing before:

    remove_filter( 'the_content', 'rocket_lazyload_images', PHP_INT_MAX );
    
    // .....
    // .....
    
    add_filter( 'the_content', 'rocket_lazyload_images', PHP_INT_MAX );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter cybmeta

    (@cybmeta)

    I think I’ve found it:

    add_filter( 'do_rocket_lazyload', '__return_false' );
    
    // ...
    
    add_filter( 'do_rocket_lazyload', '__return_true' );

    Is it right?

    Plugin Contributor WP Rocket

    (@wp_rocket)

    Hi,

    This could be a solution for your case yes, though we didn’t try that ourselves.

    Since version 2.0, lazyload is applied globally on the template_redirect action by doing output buffering to get the HTML content and modify it.

    Thread Starter cybmeta

    (@cybmeta)

    On wp_head I use post’s content to build json-ld data. I need some plugins that affect the content be active and other plugins be inactive. For example, I need original images src attribute, so I need to deactivate your plugin. That is the use case and the proposed solution seems to work.

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘rocket_lazyload_images filter removed since version 2.0, ?alternative?’ is closed to new replies.