Make WordPress Core

Opened 12 months ago

Last modified 12 months ago

#51861 new feature request

Introduce "theme deleted" action

Reported by: martin.krcho Owned by:
Milestone: Awaiting Review 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 12 months ago.
Patch introducing deleted_theme action

Download all attachments as: .zip

Change History (3)

12 months ago

Patch introducing deleted_theme action

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

12 months ago

  • Keywords has-patch added

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

Trac ticket: https://core.trac.wordpress.org/ticket/51861

#2 @prbot
12 months ago

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

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

Note: See TracTickets for help on using tickets.