Support » Plugin: NextGEN Gallery - WordPress Gallery Plugin » [Plugin: NextGEN Gallery] Filter 'ngg_pre_add_new_image' applied twice

  • Resolved tinuzz



    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,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Added an issue in trac. Hope it will be acted upon.



    Please not in trac, put it as issue on my GoogleCode page. I will look into it during weekend

    Hi Alex,

    Sorry, I didn’t know NextGEN was in Google code. I created three tickets in Trac yesterday. Will copy them to Google.


Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: NextGEN Gallery] Filter 'ngg_pre_add_new_image' applied twice’ is closed to new replies.