• Znuff

    (@znuff)


    As per title, your wp_enqueue_scripts in Controllers/Frontend/FrontendAssetsController.php do not set jquery as a dependency, thus they are sometimes loaded /before/ jQuery is available and they render the gallery broken.

    Solution:

    Add jQuery as a depedency:

    
    wp_enqueue_script('gd_lightbox_fullscreen', \GDLightbox()->pluginUrl().'/resources/assets/js/frontend/lg-fullscreen.js', array('jquery') );
    
    • This topic was modified 7 years ago by Znuff.

The topic ‘No dependency on jQuery in wp_enqueue_script’ is closed to new replies.