Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmudev-sls/da9dea6cde3181139157c7aa7f30a9c3 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/da9dea6cde3181139157c7aa7f30a9c3 to your computer and use it in GitHub Desktop.
[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