[wp-trac] [WordPress Trac] #49915: Function registered on `upgrader_process_complete` does not run on first update.

WordPress Trac noreply at wordpress.org
Thu Apr 16 01:04:17 UTC 2020


#49915: Function registered on `upgrader_process_complete` does not run on first
update.
--------------------------+-----------------------------
 Reporter:  apedog        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Cron API      |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Adding the following line to a plugin will not run on first plugin update:
 {{{
 add_action( 'upgrader_process_complete', 'my_upgrade_routine', 10, 2 );
 }}}
 However on subsequent plugin upgrades it ''will'' run.
 ie. {{{my_upgrade_routine()}}} will only run if it had already been
 registered on a previous plugin update.
 It will ''not'' run if it was added in current update.
 I'm assuming this also happens if the function name is changed. I've not
 tested this.

 I have a custom plugin that updates from a github repo using a third-party
 plugin updater (that is reliable and stable).
 I am testing this by manually running {{{wp_version_check}}} from WP-
 Crontrol plugin page.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/49915>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list