Documentation > Developers > Action Hooks

Action Hooks

The following hooks are triggered at various picu events.

Learn about Action Hooks.


After Saving Selection

picu_after_saving_selection

This one is pretty powerful. It gets triggered each time the selection is saved, which in turn happens every time an image is selected or when a comment is created for an individual image.

We have created an example snippet on how to implement a new comment notification.


Before Approval

picu_before_approval

This hook is fired right before the approval. It can be used to process collection or approval form data or to do some additional validation before the collection is approved for the client.

You can use it like this:

function my_picu_before_approval( $collection_id, $ident, $approval_message ) {
    // Do something
}

add_action( 'picu_before_approval', 'my_picu_after_approval', 10, 3 );Code language: PHP (php)

After Approval

picu_after_approval

This hook is fired each time after a collection has been approved.

You can use it like this:

function my_picu_after_approval( $collection_id, $ident ) {
    // Do something
}

add_action( 'picu_after_approval', 'my_picu_after_approval', 10, 2 );Code language: PHP (php)

Usage examples are to automatically send a thank you email or to automatically close a collection after the last client has sent their approval.


After Email Sent

picu_after_email_sent

This gets triggered every time picu sends an email.

You can use it like this:

function my_picu_after_email_sent( $mail_context, $collection_id ) {
    // Do something
}

add_action( 'picu_after_email_sent', 'my_picu_after_email_sent', 10, 2 );Code language: PHP (php)

Need help?

If you couldn’t find what you were looking for and need more assistance, please get in touch with us directly and we’re happy to help.