Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#30127 closed enhancement (fixed)

Add `before_delete_term` action

Reported by: cmmarslender's profile cmmarslender Owned by: boonebgorges's profile boonebgorges
Milestone: 4.1 Priority: normal
Severity: normal Version: 4.1
Component: Taxonomy Keywords: has-patch
Focuses: Cc:


Sometimes, the need arises to hook in to wp_delete_term, and take some action before the terms are actually deleted. Currently, there are only actions that fire after changes are already made in the database (term gone, posts already updated, etc). Would be really helpful to be able to hook into this process before any changes are made.

Patch attached with proposed addition.

Attachments (1)

30127.diff (665 bytes) - added by cmmarslender 10 years ago.

Download all attachments as: .zip

Change History (6)

10 years ago

#1 @cmmarslender
10 years ago

  • Keywords has-patch added

#2 @lancewillett
10 years ago

Patch looks good to me.

#3 @boonebgorges
10 years ago

  • Milestone changed from Awaiting Review to 4.1

#4 @boonebgorges
10 years ago

'pre_' is much a much more common convention for this sort of hook in WP. We do have 'before_delete_post', but I think that's just a very old hook.

#5 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 30088:

Introduce 'pre_delete_term' hook.

Props cmmarslender.
Fixes #30127.

Note: See TracTickets for help on using tickets.