Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » [Plugin: NextGEN Gallery] Bug: ngg_render_template filter

  • 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 );

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

Viewing 1 replies (of 1 total)
  • Alex Rabe

    (@alexrabe)

    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;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: NextGEN Gallery] Bug: ngg_render_template filter’ is closed to new replies.