From 5c90df8996129d363e1bb0ab001e135d6e985eb3 Mon Sep 17 00:00:00 2001 From: Joe McGill Date: Sun, 20 Sep 2015 17:10:34 -0500 Subject: [PATCH] Content filter: Bail early if `srcset` present. --- wp-tevko-responsive-images.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/wp-tevko-responsive-images.php b/wp-tevko-responsive-images.php index c50bcfb..9bcb790 100644 --- a/wp-tevko-responsive-images.php +++ b/wp-tevko-responsive-images.php @@ -333,6 +333,11 @@ function _tevkori_filter_content_images_callback( $image ) { list( $image_html, $atts ) = $image; $id = $size = false; + // Bail early if a `srcset` attribute already exists. + if ( ! strpos( $atts, 'srcset=' ) ) { + return $image_html; + } + // Grab ID and size info from core classes. if ( preg_match( '/wp-image-([0-9]+)/i', $atts, $class_id ) ) { (int) $id = $class_id[1];