Make WordPress Core

Opened 4 years ago

Closed 2 years ago

#51861 closed feature request (duplicate)

Introduce "theme deleted" action

Reported by: martinkrcho's profile martin.krcho Owned by:
Milestone: Priority: normal
Severity: minor Version: 5.5.3
Component: Themes Keywords: has-patch
Focuses: performance Cc:


At the moment there is no hook triggered when a theme is deleted.

Can you add an action similar to deleted_plugin but for the theme uninstall? I attached a patch for WordPress 5.5.3 including the necessary changes.

It would be much nicer than having to implement workarounds involving a cron job to monitor the theme list.

Attachments (1)

patch.diff (744 bytes) - added by martin.krcho 4 years ago.
Patch introducing deleted_theme action

Download all attachments as: .zip

Change History (4)

4 years ago

Patch introducing deleted_theme action

This ticket was mentioned in PR #760 on WordPress/wordpress-develop by martinkrcho.

4 years ago

  • Keywords has-patch added

I added new action deleted_theme to be able to easily hook into a theme deletion process.

Trac ticket:

github-actions[bot] commented on PR #760:

4 years ago

Hi @martinkrcho! 👋

Thank you for your contribution to WordPress! 💖

It looks like this is your first pull request to wordpress-develop. Here are a few things to be aware of that may help you out!

No one monitors this repository for new pull requests. Pull requests must be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, please include the ticket's full URL in your pull request description.

Pull requests are never merged on GitHub. The WordPress codebase continues to be managed through the SVN repository that this GitHub repository mirrors. Please feel free to open pull requests to work on any contribution you are making.

More information about how GitHub pull requests can be used to contribute to WordPress can be found in this blog post.

Please include automated tests. Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the Automated Testing page in the handbook.

If you have not had a chance, please review the Contribute with Code page in the WordPress Core Handbook.

The Developer Hub also documents the various coding standards that are followed:

Thank you,
The WordPress Project

#3 @sabernhardt
2 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #16401.

Thanks for the ticket and the patch! The delete_theme and deleted_theme actions were added in r50826 (see ticket:16401).

Note: See TracTickets for help on using tickets.