Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 6 years ago

#35213 closed enhancement (fixed)

Pass object ids to filters in wp_delete_term()

Reported by: obenland Owned by: obenland
Priority: normal Milestone: 4.5
Component: Taxonomy Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

If a site has a large amount of posts associated with a term, custom queries hooked into delete_term or delete_$taxonomy can become very expensive. On WordPress.com we pass the affected object ids to the actions as well, allowing for a more targeted query.

Attachments (3)

35213.diff​ (2.7 KB ) - added by obenland 11 years ago.
35213.2.diff​ (6.0 KB ) - added by obenland 11 years ago.
35213.3.diff​ (6.2 KB ) - added by obenland 11 years ago.
Updated WpDeleteTerm tests with stricter assertion

Download all attachments as: .zip

Change History (8)

#1 @obenland
11 years ago

Also, $objects is the wrong variable name for this list. It should be $object_ids.

#2 @obenland
11 years ago

  • Keywords has-patch added
  • Type defect (bug) → enhancement

@obenland
11 years ago

Updated WpDeleteTerm tests with stricter assertion

This ticket was mentioned in ​Slack in #core by obenland. ​View the logs.


11 years ago

#4 @obenland
11 years ago

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

In 36080:

Taxonomy: Pass object ids to delete_* actions.

Allows for more targeted updates to affected posts in callbacks.
Disambiguates $objects variable and amends unit tests.

Fixes #35213.

#5 @DrewAPicture
11 years ago

In 36962:

Docs: Improve changelog entries added for the delete_term and delete_{$taxonomy} actions in [36080] and a third entry added for the clean_term_cache action in [36399]

See #35213, #35611. See #35986.

Note: See TracTickets for help on using tickets.