NextGEN Gallery
Bug: ngg_render_template filter (2 posts)

  1. Paul Clark
    Posted 5 years ago #

    In Next Gen Gallery 1.5.5, line 261 of core.php reads:

    $custom_template = apply_filters( 'ngg_render_template', false, $template_name );

    The apply_filters function only takes two arguments, not three; The hook $tag and the $value to be modified. Because $template_name is the third argument, it doesn't get passed to the filter. Instead the filter is always passed FALSE, which makes it impossible for plugins to detect what template is being requested through this filter.

    Instead, the line should read:
    $custom_template = apply_filters( 'ngg_render_template', $template_name );


  2. Alex Rabe
    Posted 5 years ago #

    This is the way how it works for me :

    add_filter('ngg_render_template', array(&$this, 'add_template'), 10, 2);
    function add_template( $path, $template_name = false) {
       if ($template_name == 'custom-name')
          $path = WP_PLUGIN_DIR . '/' . plugin_basename( dirname(__FILE__) ) . 'custom.php';
       return $path;

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NextGEN Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.