Skip to content

Instantly share code, notes, and snippets.

Michael Quad determin1st

Block or report user

Report or block determin1st

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@determin1st
determin1st / functions.php
Created Sep 21, 2019
ленивая загрузка <iframe> для темы WordPress
View functions.php
# фильтр для ленивой загрузки <iframe>
add_filter('embed_oembed_html', function($html) {
# проверим что это iframe
if (stripos($html, '<iframe') === false) {
return $html;
}
# проверим наличие источника
if (($a = strpos($html, ' src=')) === false) {
return $html;
}
You can’t perform that action at this time.