do_action( 'upgrader_process_complete', WP_Upgrader $upgrader , array $hook_extra )
Fires when the upgrader process is complete.
Contents
Description
See also ‘upgrader_package_options’.
Parameters
-
$upgrader
WP_Upgrader -
WP_Upgrader instance. In other contexts this might be a Theme_Upgrader, Plugin_Upgrader, Core_Upgrade, or Language_Pack_Upgrader instance.
-
$hook_extra
array -
Array of bulk item update data.
action
stringType of action. Default'update'
.type
stringType of update process. Accepts'plugin'
,'theme'
,'translation'
, or'core'
.bulk
boolWhether the update process is a bulk update. Default true.plugins
arrayArray of the basename paths of the plugins' main files.themes
arrayThe theme slugs.translations
arrayArray of translations update data.language
stringThe locale the translation is for.type
stringType of translation. Accepts'plugin'
,'theme'
, or'core'
.slug
stringText domain the translation is for. The slug of a theme/plugin or'default'
for core translations.version
stringThe version of a theme, plugin, or core.
More Information
The
upgrader_process_complete
action hook is run when the download process for a plugin install or update finishes.Use with caution: When you use the
upgrader_process_complete
action hook in your plugin and your plugin is the one which under upgrade, then this action will run the old version of your plugin.
Source
File:
wp-admin/includes/class-wp-upgrader.php
. View all referencesdo_action( 'upgrader_process_complete', $this, $options['hook_extra'] );
Changelog
Changelog Version Description 4.6.0 $translations
was added as a possible argument to$hook_extra
.3.7.0 Added to WP_Upgrader::run(). 3.6.0 Introduced.
User Contributed Notes
You must log in before being able to contribute a note or feedback.
Example migrated from Codex:
Do stuff if the current plug-in is being updated.
Example migrated from Codex:
This short plugin demonstrates how to display a notice to the user when they update the plugin. It displays a different notice when they first install the plugin:
Example migrated from Codex:
The following is example data of the $hook_extra parameter passed to this hook (as of v4.8.1):
In Parameters > $this “Core_Upgrade” should be “Core_Upgrader” and link to https://developer.wordpress.org/reference/classes/core_upgrader/