WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 4 years ago

#10962 closed enhancement (fixed)

set_object_terms should pass the old terms

Reported by: simonwheatley Owned by: westi
Milestone: 2.9 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch commit
Focuses: Cc:

Description

I'm writing a plugin which will allow tag clouds which are pinned to particular specified categories, e.g. show me the tag cloud for all posts in the "documents" category. This means I need to precache additional term counts for these categories. Because set_object_terms doesn't pass the old_tt_ids I am forced to iterate all the tags in the system in case a tag was deleted, if the old ids were passed I'd have code execution times approximately ten times faster with the number of tags in my system (lots).

The attached diff amends the set_object_terms action to also pass the old_tt_ids array.

Attachments (1)

pass old tt_ids to set_object_terms actions.diff (762 bytes) - added by simonwheatley 5 years ago.
Amends the set_object_terms action to also pass old_tt_ids

Download all attachments as: .zip

Change History (4)

simonwheatley5 years ago

Amends the set_object_terms action to also pass old_tt_ids

comment:1 scribu5 years ago

  • Keywords commit added
  • Milestone changed from Unassigned to 2.9

comment:2 scribu5 years ago

  • Summary changed from set_object_terms doesn't pass the old terms to set_object_terms should pass the old terms

comment:3 westi4 years ago

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

(In [12261]) Pass the old term_taxonomy ids to the action in set_object_terms so plugins know what was before. Fixes #10962 props simonwheatley.

Note: See TracTickets for help on using tickets.