• Resolved 3Lancer

    (@3lancer)


    Hi,

    I use Easy FancyBox, as well as Justified Image Grid + NextGEN plugins. In the previous version 1.6, I could isolate the pages for the plugin to be used upon, preventing any conflicts/overlaps between them, and optimize their loading to certain pages only.

    For example, under my theme ‘functions.php’ file:

    // Remove scripts on pages not required (Load Optimization)
    function my_conditional_script() {
    if( class_exists(‘easyFancyBox’) && ( !is_page_template( ‘page-portfolio.php’ ) && !has_post_format( array( ‘gallery’, ‘image’ ) ) && !is_singular(‘product’) && !is_post_type_archive(‘product’) ) ) {
    remove_action(‘wp_enqueue_scripts’, array(‘easyFancyBox’,’enqueue_styles’), 999);
    remove_action(‘wp_print_scripts’, array(‘easyFancyBox’,’register_scripts’), 999);
    remove_action(‘wp_head’, array(‘easyFancyBox’,’main_script’), 999);
    remove_action(‘wp_footer’, array(‘easyFancyBox’,’enqueue_footer_scripts’), 999);
    remove_action(‘wp_footer’, array(‘easyFancyBox’, ‘on_ready’), 999);
    }
    }
    add_action(‘wp_head’,’my_conditional_script’,0);

    In version 1.7, this doesn’t appear to be working anymore? It’s creating two overlapping image popups for the Justified Image Grid galleries (Pretty Photo + FancyBox). Is it still possible to do this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hmm, yes. Some things have changed that make this code not remove the script anymore… Try replacing all the remove_action(…) lines with these:

    
    remove_action( 'wp_enqueue_scripts', array(__CLASS__, 'enqueue_scripts') );
    remove_action( 'wp_head', array(__CLASS__, 'print_ie_inline_style'), 11 );
    
    Thread Starter 3Lancer

    (@3lancer)

    Thanks, that does the trick, tested and can confirm working like before again on a Development server:

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

    I noticed you have rolled back to 1.6.2 for now? Hopefully that will help others with the upgrade too?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Easy FancyBox version 1.7 – Conflict’ is closed to new replies.