Commit 7fc744d
Query term relationships directly from database
Instead of relying on wp_get_object_terms() which may have
cache issues with posts retrieved directly from the database,
query the term_relationships table directly and then fetch
full term objects. This ensures term relationships are always
retrieved correctly regardless of cache state.
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>1 parent 948aca3 commit 7fc744d
1 file changed
Lines changed: 24 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | | - | |
142 | 140 | | |
143 | 141 | | |
144 | 142 | | |
| |||
404 | 402 | | |
405 | 403 | | |
406 | 404 | | |
| 405 | + | |
407 | 406 | | |
408 | 407 | | |
409 | 408 | | |
410 | 409 | | |
411 | | - | |
412 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
413 | 423 | | |
414 | 424 | | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
415 | 435 | | |
416 | 436 | | |
417 | 437 | | |
| |||
0 commit comments