[Plugin: NextGEN Gallery] Hooks: 'ngg_delete_gallery' and 'ngg_delete_picture' a
-
Hi,
I am developing a plugin that enhances NextGEN Gallery a little bit, and uses the hooks in NGG to do stuff. Among other things, I have to do some trickery when a picture or a gallery is deleted, and for this, I suppose the hooks ‘ngg_delete_picture’ and ‘ngg_delete_gallery’, both defined in admin/manage.php, are intended.
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().
Interested to hear your views.
Best regards,
Martijn.
- The topic ‘[Plugin: NextGEN Gallery] Hooks: 'ngg_delete_gallery' and 'ngg_delete_picture' a’ is closed to new replies.