/is', $content, $matches ); $search = array(); $replace = array(); $dark_version = get_theme_mod('dark_styles', 0); $lazy_image = ETHEME_BASE_URI . 'images/lazy' . ( $dark_version ? '-dark' : '' ) . '.png'; // $l_type = get_theme_mod( 'images_loading_type_et-desktop', 'lazy' ); $l_type = get_query_var('et_img-loading-type', 'lazy'); $lazy_class = 'lazyload lazyload-' . ($l_type == 'lazy' ? 'simple' : 'lqip'); foreach ( $matches[0] as $img_html ) { if ( false !== strpos( $img_html, 'data-src' ) || false !== strpos( $img_html, 'data-original' ) || false !== strpos( $img_html, 'data-src' ) || preg_match( "/src=['\"]data:image/is", $img_html ) || false !== strpos( $img_html, 'rev-slidebg' ) || false !== strpos( $img_html, 'rs-lazyload' ) || false !== strpos( $img_html, 'avatar' ) || false !== strpos( $img_html, 'main-hover-slider-img' ) ) { continue; } if ( preg_match( '/width=["\']/i', $img_html ) && preg_match( '/height=["\']/i', $img_html ) ) { preg_match( '/width=(["\'])(.*?)["\']/is', $img_html, $match_width ); preg_match( '/height=(["\'])(.*?)["\']/is', $img_html, $match_height ); if ( isset( $match_width[2] ) && isset( $match_height[2] ) ) { if ( $match_width[2] != $match_height[2] && $match_width[2] < 100 ) { continue; } $lazy_image = etheme_placeholder_image($match_width[2] . 'x' . $match_height[2]); } } else { continue; } $replace_html = preg_replace( '/