WordPress.org

Ready to get started?Download WordPress

Forums

register_update_hook (6 posts)

  1. camu
    Member
    Posted 4 years ago #

    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

  2. camu
    Member
    Posted 4 years ago #

    bump

  3. camu
    Member
    Posted 3 years ago #

    bump again

  4. lelkoun
    Member
    Posted 3 years ago #

    bump

  5. elfin
    Moderator
    Posted 3 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.

  6. camu
    Member
    Posted 3 years ago #

    Yeah, I ended up doing the same exact thing :)

    Camu

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.