diff --git a/src/Image.php b/src/Image.php index 7372735..7437d26 100644 --- a/src/Image.php +++ b/src/Image.php @@ -841,8 +841,14 @@ public function render($src, $size, $class, $alt = '', $error = null) $img_tag = ' '; } + // Make sure we use the right protocol + $src = esc_url(is_ssl() ? str_ireplace("http://", "https://", $src) : $src); + // Get srcset, if available $srcset = $this->get_srcset($src); - $src = 'src="' . esc_url(is_ssl() ? str_ireplace("http://", "https://", $src) : $src) . '"' . $srcset; + + $src = 'src="' . $src. '"' . $srcset; + + // Lazy Load attribute, if enabled $lazyload = ( $this->admin_options['tools']['markup']['thumbnail']['lazyload'] ) ? ' loading="lazy"' : ''; $img_tag .= '' . esc_attr($alt) . '';