1

I am trying to send a list of plugin names via email after plugins bulk update.

Using this hook, my function sent various emails, each one with one plugin name because the action is run after each plugin's update:

add_action( 'upgrader_process_complete', 'inv_update_service_notification_send_function',10, 2);

This hook is not fired and does not call my function:

add_action('update_bulk_plugins_complete_actions','inv_update_service_notification_send_function',10,2);

Is there a hook that is called once the entire plugin bulk update process is completed?

1

I think the action you're looking for is indeed upgrader_process_complete

The Codex page doesn't say specifically, so I'm not totally certain if it runs for each plugin or after all of them, but it works for me :-)

function bgmc_plugins_update_completed( $upgrader_object, $options ) {

    // If an update has taken place and the updated type is plugins and the plugins element exists
    if ( $options['action'] == 'update' && $options['type'] == 'plugin' && isset( $options['plugins'] ) ) {
        // code here
    }
}
add_action( 'upgrader_process_complete', 'bgmc_plugins_update_completed', 10, 2 );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.