Attention Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Action Reference/upgrader process complete

This page is marked as incomplete. You can help Codex by expanding it.


The upgrader_process_complete action hook is run when the download process for a plugin install or update finishes.

It is passed two arguments: an instance of the WP_Upgrader() class and the $hook_extra array.


   my_upgrate_function( $this, $data )
   $this - (Plugin_Upgrader) Plugin_Upgrader instance. In other contexts, $this, might be a Theme_Upgrader or Core_Upgrade instance.
   $data (array)
       'action'   -(string) Type of action. Default 'update'.
       'type'     -(string) Type of update process. Accepts 'plugin', 'theme', or 'core'.  Default:'plugin'
       'bulk'     - (bool) Whether the update process is a bulk update. Default true.
       'packages' -  (array) Array of plugin, theme, or core packages to update.


// HAVENT TESTED THIS FUNCTION, but an assumption

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

function my_upgrate_function( $upgrader_object, $options ) {
    $current_plugin_path_name = plugin_basename( __FILE__ );

    if ($options['action'] == 'update' && $options['type'] == 'plugin' ){
       foreach($options['packages'] as $each_plugin){
          if ($each_plugin==$current_plugin_path_name){
             // .......................... YOUR CODES .............