Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#30127 closed enhancement (fixed)

Add `before_delete_term` action

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

Description

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 12 years ago.

Download all attachments as: .zip

Change History (6)

@cmmarslender
12 years ago

#1 @cmmarslender
12 years ago

  • Keywords has-patch added

#2 @lancewillett
12 years ago

Patch looks good to me.

#3 @boonebgorges
12 years ago

  • Milestone Awaiting Review → 4.1

#4 @boonebgorges
12 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
12 years ago

  • Owner set to boonebgorges
  • Resolution → fixed
  • Status new → closed

In 30088:

Introduce 'pre_delete_term' hook.

Props cmmarslender.
Fixes #30127.

Note: See TracTickets for help on using tickets.