samtiria / nextgen-gallery

Automatically exported from code.google.com/p/nextgen-gallery
0 stars 0 forks source link

Missing 'ngg_delete_picture' hook when deleting images via bulk actions #447

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Write a WP plugin that defines a 'ngg_delete_picture' action
2. See it work when deleting an image with the 'delete' link from the admin page
3. See it NOT work when deleting images through 'Bulk actions'

What version of the product are you using? On what operating system?

NGG 1.9.0 on WP 3.2.1

Please provide any additional information below.

When a single image is deleted via the 'delete' link, an action named 
'ngg_delete_picture' is run from function processor().

When a gallery is deleted, an action named 'ngg_delete_gallery' is run from 
function post_processor_galleries().

However, when one or more images are deleted by selecting them and choosing 
'delete images' from the Bulk actions menu, no hooks are activated.

In function post_processor_images(), which processes the bulk action, no 
do_action call of any sort is done.

For consistence, please add a hook there as well. My plugin needs it :-)

I propose to add:

do_action('ngg_delete_picture', $imageID);

just below:

              $image = $nggdb->find_image( $imageID );
              if ($image) {

in function post_processor_images().

Original issue reported on code.google.com by martijng...@gmail.com on 9 Dec 2011 at 8:32

GoogleCodeExporter commented 8 years ago
fixed in r1051

Original comment by alex.cologne on 10 Dec 2011 at 1:05