WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] template_redirect should be wp_print_scripts/wp_print_styles? (5 posts)

  1. webaware
    Member
    Posted 1 year ago #

    G'day, thanks for your excellent plugin.

    I am using NextGEN to manage the image carousels in the page headers of a website I'm working on. A simple custom template means I can have an image carousel with thumbnails that can be clicked to navigate the carousel. Very nice, and easy thanks to NextGEN.

    It all works really well, except on pages mangled^H^H^H^H^H^H^Hmanaged by wp-e-commerce. For once, it isn't the fault of wp-e-commerce! On these pages, the page template is redirected to a different template using the template_redirect action. As is normal with this action, once the template has been redirected, exit is called and the script ends. Any other template_redirect action hooks in the queue after wp-e-commerce's hook are thus discarded.

    What this means for NextGEN is that nggLoader::load_scripts() and nggLoader::load_styles() are never called on the wp-e-commerce purchase page. This is because NextGEN uses the template_redirect action to enqueue its scripts and styles. This is not what this action is meant for :)

    When I replace the template_redirect action with wp_print_scripts and wp_print_styles in nextgen-gallery/nggallery.php, everything works as it should; specifically, the script ngg.slideshow.min.js which runs the image carousel is loaded.

    So: is there a good reason for hooking template_redirect instead of wp_print_scripts and wp_print_styles? Patching the plugin to use the "correct" hooks fixes my problem, but are you using template_redirect instead for a reason?

    cheers,
    Ross

    http://wordpress.org/extend/plugins/nextgen-gallery/

  2. webaware
    Member
    Posted 1 year ago #

    Now reported on bitbucket issue tracker.

  3. webaware
    Member
    Posted 1 year ago #

    1.9.6 is now released, still without this fix. I also can no longer access the defect report on bitbucket. Can Photocrati please confirm that this issue will be addressed in an upcoming release? I'm currently having to merge my patch with your releases for one client each time you make a new release.

    cheers,
    Ross

  4. photocrati
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Webaware - we do have the issue and your proposed fix and it's on our list. Our developers just need to review it to ensure it works and doesn't cause any other unintended issues. Thanks for taking the time to submit a fix!

  5. webaware
    Member
    Posted 1 year ago #

    Excellent, thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.