Created
August 20, 2019 13:49
-
-
Save andxbes/fcc0494d529f5eb0f5437eea09ea02ac to your computer and use it in GitHub Desktop.
Исправление lazyload Autoptimize
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('autoptimize_filter_imgopt_lazyload_cssoutput', function($string) { | |
ob_start(); | |
?> | |
<script>document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend","<?= $string ?>");</script> | |
<?php | |
return ob_get_clean(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment