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/8023b5d2017f91be52c5ac5ec2876658 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/8023b5d2017f91be52c5ac5ec2876658 to your computer and use it in GitHub Desktop.
[Smush] - Fix lazyload not working with single image of kingcomposer
<?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