My plugin needs to fire an init/build/checker function when the plugin is updated via auto updates in the WP dashboard.
Is there a WordPress hook that is fired after a plugin has been updated from the wordpress.org repository?
I'm not looking for register_activation_hook
or register_deactivation_hook
as those only execute on manual activation/deactivation.
Use this hook whenever you need to compare values before and after the post update. This hook runs after the database update.
Hooks are a way for one piece of code to interact/modify another piece of code at specific, pre-defined spots. They make up the foundation for how plugins and themes interact with WordPress Core, but they're also used extensively by Core itself. There are two types of hooks: Actions and Filters.
WordPress offers filter hooks to allow plugins to modify various types of internal data at runtime. A plugin can modify data by binding a callback to a filter hook. When the filter is later applied, each bound callback is run in order of priority, and given the opportunity to modify a value by returning a new value.
Yes, upgrader_process_complete
[see also: core reference] does that. Inspect the second parameter to know if it is a core, plugin or theme update; and if it is bulk or not.
add_action( 'upgrader_process_complete', function( $upgrader_object, $options ) {
// inspect $options
}, 10, 2 );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With