What steps will reproduce the problem?
1. Create a WP plugin that defines 'ngg_delete_gallery' and
'ngg_delete_picture' hooks
2. Try to write code that acts on the deleted gallery or picture
3. Find that there is nothing left that is tied to the ID, because deletion of
files and data has occurred before the hook is activated.
What version of the product are you using? On what operating system?
NGG 1.9.0, WP 3.2.1
Please provide any additional information below.
In admin/manage.php, two actions are called after deleting images and
galleries: 'ngg_delete_picture' and 'ngg_delete_gallery'.
In both cases, the relevant IDs are passed. However, these hooks are called
after the whole deletion process is completed, including removal of the picture
or gallery from the database.
So, by the time any hooks are executed, you have an ID that doesn't mean
anything anymore (everything related to it is gone), and there is no way to
recover any information about the deleted items. That makes the hooks quite
useless, from my point of view.
My request is to move both hooks upward a litte.
do_action('ngg_delete_picture', $this->pid)
should be called right after
$image = $nggdb->find_image( $this->pid );
if ($image) {
in function processor().
do_action('ngg_delete_gallery', $id);
should be called right after:
$gallery = nggdb::find_gallery($id);
if ($gallery){
in function post_processor_galleries().
Original issue reported on code.google.com by martijng...@gmail.com on 9 Dec 2011 at 8:25
Original issue reported on code.google.com by
martijng...@gmail.com
on 9 Dec 2011 at 8:25