Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » [Plugin: NextGEN Gallery] template_redirect should be wp_print_scripts/wp_print_styles?

  • Resolved webaware


    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?


Viewing 4 replies - 1 through 4 (of 4 total)
  • Now reported on bitbucket issue tracker.

    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.


    Plugin Author photocrati


    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!

    Excellent, thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Plugin: NextGEN Gallery] template_redirect should be wp_print_scripts/wp_print_styles?’ is closed to new replies.