Plugin update key

My plugin should run the init / build / checker function when the plugin is updated through automatic updates in the WP control panel.

Is there a WordPress hook that starts after updating a plugin from the wordpress.org repository?

I am not looking for register_activation_hook or register_deactivation_hook , as they only execute when manually activated / deactivated.

+8
plugins wordpress hook activation
source share
1 answer

Yes, upgrader_process_complete [see also: base link ] does this. Inspect the second parameter to see if it is a kernel, plugin or theme update; and if it is voluminous or not.

 add_action( 'upgrader_process_complete', function( $upgrader_object, $options ) { // inspect $options }, 10, 2 ); 
+12
source share

All Articles