#is', $in);
// extract img tags and add lazyload attribs.
if (preg_match_all('#
]*src[^>]*>#Usmi', $out, $matches)) {
foreach ($matches[0] as $tag) {
$to_replace[$tag] = $this->add_lazyload_for_images($tag);
}
$out = str_replace(array_keys($to_replace), array_values($to_replace), $out);
}
// restore noscript tags.
$out = twoptimizeBase::restore_marked_content('SCRIPT', $out);
return $out;
}
public function filter_lazyload_iframes($in)
{
// only used is image optimization is NOT active but lazyload is.
$to_replace = array();
// hide (no)script tags to avoid nesting noscript tags (as lazyloaded images add noscript).
$out = twoptimizeBase::replace_contents_with_marker_if_exists('SCRIPT', '