• Resolved tinuzz

    (@tinuzz)


    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.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter tinuzz

    (@tinuzz)

    Added an issue in trac. Hope it will be acted upon.

    Regards,
    Martijn.

    Martijn,

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

    Thread Starter tinuzz

    (@tinuzz)

    Hi Alex,

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

    Thanks,
    Martijn.

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.