Repository navigation
Commit 600421d
committed
Align batches with the posts iterator and keep the database term order
The posts iterator queries chunks of post IDs without an ORDER BY, so
the first post it returns is not necessarily the first ID of its chunk.
Start the batch at the chunk boundary, as otherwise e.g. an export of
`--post__in` IDs in descending order loaded a batch for every post.
Terms come back from the database ordered by name in its collation, so
keep that order and only order terms with the same name by their
term_taxonomy_id, instead of sorting them by name in PHP.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D26yjkN2BiqCXT6p6o1WqS1 parent 3c78416 commit 600421d
2 files changed
Lines changed: 43 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1370 | 1370 | | |
1371 | 1371 | | |
1372 | 1372 | | |
1373 | | - | |
| 1373 | + | |
1374 | 1374 | | |
1375 | 1375 | | |
1376 | 1376 | | |
| |||
1421 | 1421 | | |
1422 | 1422 | | |
1423 | 1423 | | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
1424 | 1428 | | |
1425 | 1429 | | |
1426 | 1430 | | |
| |||
1437 | 1441 | | |
1438 | 1442 | | |
1439 | 1443 | | |
1440 | | - | |
| 1444 | + | |
| 1445 | + | |
1441 | 1446 | | |
1442 | 1447 | | |
1443 | 1448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
463 | | - | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
464 | 466 | | |
465 | 467 | | |
466 | 468 | | |
| |||
495 | 497 | | |
496 | 498 | | |
497 | 499 | | |
498 | | - | |
499 | | - | |
| 500 | + | |
| 501 | + | |
500 | 502 | | |
501 | | - | |
502 | | - | |
503 | | - | |
504 | | - | |
505 | | - | |
506 | | - | |
| 503 | + | |
507 | 504 | | |
508 | 505 | | |
509 | 506 | | |
| |||
541 | 538 | | |
542 | 539 | | |
543 | 540 | | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
544 | 571 | | |
545 | 572 | | |
546 | 573 | | |
| |||
0 commit comments