Last active
October 18, 2019 05:14
-
-
Save wpmudev-sls/da9dea6cde3181139157c7aa7f30a9c3 to your computer and use it in GitHub Desktop.
[Smush Pro] - Enable Include/Exclude Lazyload Function While Enable CDN
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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