I would like to run several actions on a website once WP core or any of the plugins have been updated using the built-in update process. Is there a way to do it?
I would prefer if I could run commands on 3 different cases:
- WP core update is finished
- A single plugin update has been
finished - A bulk update for plugins has been finished (so that I
run the command only
after all of them have been finished)
Hooks
The hooks you’re searching for are
and
The later takes three arguments. Example:
and should be used for: Move & activate the plugin, echo the update message.
Moving plugins
Moving works like this:
Then use
activate_plugin( 'path/file' );
after moving.