Hello all,
I'm developing a plugin and I need to trigger a function only when the plugin is updated (via the WordPress admin interface, of course). Is there a way to do this? I know we have register_activation_hook, but this is not triggered during the update. Any thoughts?
Thanks,
camu
lelkoun
Member
Posted 2 years ago #
I add an action to init
add_action('init','my_update_routine',1);
and do a check for the existence of a value in the database (plugin version number), and only including the upgrade routine if necessary, otherwise returning false.
Yeah, I ended up doing the same exact thing :)
Camu