Don't push posts to queue on a term update if 'name', 'slug', 'parent', 'term_taxonomy_id' are not modified during the update.
Description
Currently, the SyncManager operates on edited_term, unfortunately, even a simple wp_update_term that doesn't have any field update triggers the hook, so potentially anyone can go to the term edit screen, hit update, and cause a full re-index of documents with that term, which is not ideal.
This PR aims to address that with a bit of hackery:
First on edit_terms - that happens PRIOR the term update we store the term
Second, on edited_terms we fetch the new term and compare to the previously stored.
Only index if the term was actually updated .
Profit
Checklist
Please make sure the items below have been covered before requesting a review:
[ ] This change works and has been tested locally (or has an appropriate fallback).
[ ] This change works and has been tested on a Go sandbox.
[ ] This change has relevant unit tests (if applicable).
[ ] This change has relevant documentation additions / updates (if applicable).
[ ] This change has the fix PRed upstream (if applicable). If not applicable, it has the relevant "// VIP: reason for the discrepancy with upstream" comment in places where the code is discrepant.
Don't push posts to queue on a term update if 'name', 'slug', 'parent', 'term_taxonomy_id' are not modified during the update.
Description
Currently, the SyncManager operates on
edited_term
, unfortunately, even a simplewp_update_term
that doesn't have any field update triggers the hook, so potentially anyone can go to the term edit screen, hitupdate
, and cause a full re-index of documents with that term, which is not ideal.This PR aims to address that with a bit of hackery:
edit_terms
- that happens PRIOR the term update we store the termedited_terms
we fetch the new term and compare to the previously stored.Checklist
Please make sure the items below have been covered before requesting a review:
Steps to Test