There was a discussion a few years earlier about adding register_update_hook()
but it has never been implemented on the core. The idea was to have a hook just like we have one for activation register_activation_hook
.
I am not sure but I am assuming that when a plugin gets updated it deactivates itself beforehand and gets reactivated silently. If that is the case, then you probably would need to use the register_activation_hook
function and create an option using add_option
(see code below).
If my assumption is wrong try to force a plugin deactivation when the user clicks on the update button so you can use the hook.
register_activation_hook(__FILE__, 'my_plugin_update');
add_action('admin_init', 'my_plugin_redirect');
function my_plugin_update() {
add_option('my_plugin_do_update_redirect', true);
}
function my_plugin_redirect() {
if (get_option('my_plugin_do_update_redirect', false)) {
delete_option('my_plugin_do_update_redirect');
wp_redirect('index.php?page=abc-welcome-page');
}
}