[wp-trac] [WordPress Trac] #14955: Themes should support uninstall.php or uninstall hook

WordPress Trac noreply at wordpress.org
Fri May 7 15:53:40 UTC 2021


#14955: Themes should support uninstall.php or uninstall hook
-------------------------+-------------------------
 Reporter:  WraithKenny  |       Owner:  (none)
     Type:  enhancement  |      Status:  closed
 Priority:  normal       |   Milestone:
Component:  Themes       |     Version:
 Severity:  normal       |  Resolution:  maybelater
 Keywords:  has-patch    |     Focuses:
-------------------------+-------------------------
Changes (by desrosj):

 * keywords:  has-patch dev-feedback => has-patch
 * status:  new => closed
 * resolution:   => maybelater


Comment:

 I came across this looking for a theme equivalent to `deleted_plugin` hook
 only to find it doesn't exist yet.

 [attachment:"14955.2.diff"] looks like it would solve my use case, but it
 does not address the original ask of the ticket. Since an active theme
 cannot be deleted, any hooks in the theme will not be registered, so using
 `deleted_theme` wouldn't work. I'm reopening #16401 and will use that
 ticket to commit these hooks.

 I do see a difference between using `switch_theme` and waiting to delete
 options until the theme is actually deleted. It's not uncommon to switch
 themes to try a new one out before switching back if you prefer the old
 one. If a theme used `switch_theme` to remove custom settings or options,
 the user would lose their customizations.

 That said, the purpose of and concept of what constitutes a theme is
 undergoing a massive shift with the introduction of full site editing in
 5.8 and `theme.json` files. I don't know that I see a clear use case of an
 uninstall hook in FSE era themes yet.

 With that in mind, and that this ticket has seen no meaningful movement in
 5+ years, I'm going to close this out as a `maybelater`. Discussion can
 always continue on `maybelater` tickets, and they can be reopened once
 things become more clear.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/14955#comment:35>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list