Forked from LesykJulia/image-comparison-accordion-widgets-images-loading-fix.php
Last active
October 20, 2022 07:33
-
-
Save Crocoblock/c1876b67114e944fbee9c7c36821b0f9 to your computer and use it in GitHub Desktop.
Fix images loading when logged out in the Image Comparison and Accordion widgets
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_action( 'init', function(){ | |
global $wp_scripts; | |
$script = $wp_scripts->query( 'imagesloaded', 'registered' ); | |
if ( ! $script ) { | |
return; | |
} | |
if ( ! in_array( 'jquery', $script->deps ) ){ | |
$script->deps[] = 'jquery'; | |
} | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment