Make WordPress Core

Opened 2 months ago

Last modified 3 days ago

#50674 accepted enhancement

Plugin and Theme Update Hooks

Reported by: davidbaumwald Owned by: pbiron
Milestone: 5.6 Priority: normal
Severity: normal Version:
Component: Upgrade/Install Keywords: 2nd-opinion
Focuses: Cc:


With plugin and theme auto-updates shipping with core in 5.5, I think it's worth considering adding some more hooks around the plugin and theme process to perhaps run prior to and after a particular update is run. Hooks like plugin_updated and theme_updated, and maybe some pre_* versions of those.

Change History (7)

#1 @pbiron
2 months ago

@davidbaumwald WP_Upgrader and WP_Automatic_Upgrader already have a number of hooks like that, e.g.

Do you have specific use cases that those don't cover?

Last edited 2 months ago by pbiron (previous) (diff)

#2 @davidbaumwald
2 months ago

I had considered upgrader_process_complete for my specific use-case, but you have to weed through a bunch of data to determine the object being updated. I was thinking of more granular hooks that fired globally when a plugin/theme is updated, auto or manual.

#3 @desrosj
5 weeks ago

  • Version trunk deleted

This ticket was mentioned in Slack in #core-auto-updates by pbiron. View the logs.

3 days ago

#5 @pbiron
3 days ago

@davidbaumwald Do you still have need for more specific hooks? If so, can you provide use cases where existing hooks don't work? If not, feel free to close this :-)

#6 @davidbaumwald
3 days ago

@pbiron It's not that the existing hooks "don't work" for the use-cases I've encountered. The request here is a quality of life enhancement. Instead of digging through the existing hooks to determine the type and item(s) affected, it would be nice to have more granular filters that apply to a specific update type and pass a single item.

Since plugin and theme auto-updates are now part of core, the number of potential use-cases for these types of hooks has increased for developers who need to detect when things update, since they can now be unattended.

#7 @pbiron
3 days ago

  • Milestone changed from Awaiting Review to 5.6
  • Owner set to pbiron
  • Status changed from new to accepted

Sorry if I wasn't clear: I'm definitely not against adding additional hooks...just looking to you to tell us which new hooks to add :-)

I'm adding this to the 5.6 milestone.

Note: See TracTickets for help on using tickets.