[Plugin: NextGEN Gallery] Filter 'ngg_pre_add_new_image' applied twice
-
Hi,
In admin/functions.php is code to import galleries from file system folders. When this is run, a filter named ‘ngg_pre_add_new_image’ is applied twice, which seems wrong to me.
First, in function import_gallery, this line can be found:
$picture = apply_filters('ngg_pre_add_new_image', $picture, $gallery_id);
just before the images are added to the database with
nggAdmin::add_Images($gallery_id, $new_images);
However, in function add_Images, the first thing that is done for each image, is apply the filter again:
if ( is_array($imageslist) ) {
foreach($imageslist as $picture) {// filter function to rename/change/modify image before
$picture = apply_filters('ngg_pre_add_new_image', $picture, $galleryID);Since add_Images is called in many places, it seems to me that that would be the correct place to apply the filter. The explicit filter application in function import_gallery should be removed.
Best regards,
Martijn.
- The topic ‘[Plugin: NextGEN Gallery] Filter 'ngg_pre_add_new_image' applied twice’ is closed to new replies.