Created
June 19, 2019 17:46
-
-
Save wpmudev-sls/8023b5d2017f91be52c5ac5ec2876658 to your computer and use it in GitHub Desktop.
[Smush] - Fix lazyload not working with single image of kingcomposer
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] - Fix lazyload not working with single image of kingcomposer | |
* Description: [Smush] - Fix lazyload not working with single image of kingcomposer - 1127326695308889 | |
* Plugin URI: https://premium.wpmudev.org/ | |
* Author: WPMUDEV | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { | |
exit; | |
} | |
add_filter( 'shortcode_kc_single_image', 'wpmudev_smush_kingcomposer_default_class_for_single_image' ); | |
function wpmudev_smush_kingcomposer_default_class_for_single_image( $atts ){ | |
if( empty( $atts['ieclass'] ) ){ | |
$atts['ieclass'] = 'wpmudev-img'; | |
} | |
return $atts; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment