Incompatibility with Woocommerce – duplicate enqueing of fancybox
-
Had a slight problem using instapress alongside woocommerce, as both try to enqueue a script file with handle “fancybox”. I was in a hurry, so I just changed instapress.php to use a different handle:
// Fancybox wp_register_script('fancybox-instapress', plugins_url('/fancybox/jquery.fancybox-1.3.4.pack.js', __FILE__), array('jquery'), "1.3.4"); // Default JS wp_enqueue_script('instapress', plugins_url('/instapress.js', __FILE__), array('jquery', 'fancybox-instapress'), InstagramPlugin::getVersion(), true);
Possibly the correct solution would be for one (or both) plugins to do a check to see if the library is already registered. [Codex function reference below]
- The topic ‘Incompatibility with Woocommerce – duplicate enqueing of fancybox’ is closed to new replies.