Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Smush Pro] - Enable Include/Exclude Lazyload Function While Enable CDN
<?php
/**
* Plugin Name: [Smush Pro] - Enable Include/Exclude Lazyload Function While Enable CDN
* Description: [Smush Pro] - Enable Include/Exclude Lazyload Function While Enable CDN - 1132073378646021
* Author: Thobk @ WPMUDEV
* Author URI: https://premium.wpmudev.org
* License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'plugins_loaded', 'wpmudev_smpro_enable_inexclude_lazyload_while_cdn_activated_func', 100 );
function wpmudev_smpro_enable_inexclude_lazyload_while_cdn_activated_func() {
if( defined('WP_SMUSH_VERSION') && class_exists( 'Smush\WP_Smush' ) ){
add_filter( 'smush_skip_image_from_lazy_load', 'wpmudev_smpro_maybe_skip_lazy_load_parse' );
function wpmudev_smpro_maybe_skip_lazy_load_parse( $skip ){
return Smush\WP_Smush::get_instance()->core()->mod->lazy->maybe_skip_parse( $skip );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.