Skip to content

Commit

Permalink
#4342 - Removed srcset of fallback image only for wp rocket
Browse files Browse the repository at this point in the history
  • Loading branch information
WasimM3 committed Jul 2, 2020
1 parent 11d8198 commit b4fbaf3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion templates/features.php
Original file line number Diff line number Diff line change
Expand Up @@ -8268,7 +8268,9 @@ function ampforwp_add_fallback_element($content='',$tag=''){
$m1_content = str_replace($swidth, $width_rep, $m1_content);
$m1_content = str_replace($sheight, $height_rep, $m1_content);
$m1_content = str_replace($salt, $alt_rep, $m1_content);
$m1_content = preg_replace('/srcset="(.*?)"/', '', $m1_content);
if(function_exists('rocket_activation')){
$m1_content = preg_replace('/srcset="(.*?)"/', '', $m1_content);
}
$fallback_img = "<amp-img ".$m_content."<amp-img fallback ".$m1_content."</amp-img></amp-img>";//$m_content, $m1_content escaped above.
$content = str_replace("$match", $fallback_img, $content);
}
Expand Down

0 comments on commit b4fbaf3

Please sign in to comment.