[wp-trac] [WordPress Trac] #16401: Add hook to delete_theme() on successful delete

WordPress Trac noreply at wordpress.org
Fri May 7 16:01:20 UTC 2021


#16401: Add hook to delete_theme() on successful delete
---------------------------+-----------------------
 Reporter:  scottconnerly  |       Owner:  (none)
     Type:  enhancement    |      Status:  reopened
 Priority:  normal         |   Milestone:  5.8
Component:  Themes         |     Version:  3.0.4
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:
---------------------------+-----------------------
Changes (by desrosj):

 * keywords:   => has-patch
 * status:  closed => reopened
 * resolution:  duplicate =>
 * milestone:   => 5.8


Old description:

> Add an action or filter to the end of /wp-admin/includes/theme.php
> delete_theme()'s processing when the write is successful.
>
> The use case is for managing a Wordpress install on an SVN-controlled
> server. Whenever the CMS changes a file or folder (particularly in the
> wp-content folder) I need to be able to trigger an svn commit.
>
> See also Ticket #16396.

New description:

 Add an action or filter to the end of /wp-admin/includes/theme.php
 delete_theme()'s processing when the write is successful.

 The use case is for managing a WordPress install on an SVN-controlled
 server. Whenever the CMS changes a file or folder (particularly in the wp-
 content folder) I need to be able to trigger an svn commit.

 See also Ticket #16396.

--

Comment:

 I'm reopening this as I feel #14955 is a bit different. That ticket aims
 to provide a way for the theme being deleted/uninstalled to clean up after
 itself. But this suggestion is more for a general action hook that would
 fire when a theme is deleted successfully.

 Since an active theme cannot be deleted, it would not be possible for a
 theme to use these hooks for the purpose of cleanup.

 `delete_theme`/`deleted_theme` theme hooks would also bring parity to the
 plugin deletion process.

 [attachment:"16401.diff"] is a refresh of a patch from #14955 worked on by
 @pbiron and @vetyst that adds these hooks.

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


More information about the wp-trac mailing list