WordPress.org

Ready to get started?Download WordPress

Forums

NextGEN Gallery
[resolved] Filter 'ngg_pre_add_new_image' applied twice (4 posts)

  1. tinuzz
    Member
    Posted 3 years ago #

    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/

  2. tinuzz
    Member
    Posted 3 years ago #

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

    Regards,
    Martijn.

  3. Alex Rabe
    Member
    Posted 3 years ago #

    Martijn,

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

  4. tinuzz
    Member
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.