• Resolved 3Lancer

    (@3lancer)


    Hi again,

    I previously addressed this on version 1.7 here:
    https://www.ads-software.com/support/topic/easy-fancybox-version-1-7-conflict/

    Which worked fine, but the newer version 1.8 has changed again on the script loading. I would like to do the same, isolating the pages for the plugin to be used upon, via my theme “functions.php”.

    Another idea could be adding a backend option settings in the plugin itself to ‘Add libraries globally’ (on or off)? If off, then a text box which allows you to include certains pages just by their WordPress page number or their unique title perhaps, separated by commas (for example: homepage,58,119,store).

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi @3lancer, this should still be working:

    
    remove_action( 'wp_enqueue_scripts', array('easyFancyBox', 'enqueue_scripts') );
    

    only the remove style is not needed anymore (unless you are on WP pre-4.5).

    Exception: when you have set the new option “FancyBox script priority” on Settings > Media to any number but the default (10), then you need to copy that number (11 in this example) over to the exclude line like this :

    
    remove_action( 'wp_enqueue_scripts', array('easyFancyBox', 'enqueue_scripts'), 11 );
    

    Ah, hang on… you’ve found a bug: the remove action needs a , 0 there at the end if the option “FancyBox script priority” is empty. It’s not properly defaulting to 10 as it should be.

    Please go to Settings > Media and set “FancyBox script priority” to 10 and save the settings. Your original script exclusion function should start working again.

    Thread Starter 3Lancer

    (@3lancer)

    Works!

    FancyBox script priority = 10

    And ticking the options…

    Do not include standard WordPress jQuery library (do this only if you are sure jQuery is included from another source!)

    Do not use wp_add_inline_script/style functions (may solve issues with older script minification plugins)

    Did the trick.

    ps: I already have jQuery loaded on the theme, so that option helps too. Cheers.

    Glad to hear it ?? thanks for the feedback, helping me to spot the bug!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Easy Fancybox version 1.8 (isolating scripts page load)’ is closed to new replies.