Skip to content

fix(core): preserve manual pick order in e-picker-query-loop (0.15.3)#3

Merged
palicko merged 2 commits into
mainfrom
fix/picker-query-loop-orderby
Jul 2, 2026
Merged

fix(core): preserve manual pick order in e-picker-query-loop (0.15.3)#3
palicko merged 2 commits into
mainfrom
fix/picker-query-loop-orderby

Conversation

@palicko

@palicko palicko commented Jul 2, 2026

Copy link
Copy Markdown
Member

Problem

The Posts Picker Query Loop (webentor/e-picker-query-loop) ignores the order editors arrange picked posts in. Items always render in publish-date order regardless of how they are reordered in the editor.

Root cause

The block stores the hand-picked order in its posts attribute and builds WP_Query with post__in, but never set orderby. WP_Query therefore fell back to its default orderby => date, order => DESC and re-sorted results by publish date, discarding the chosen order on the frontend.

Fix

Add 'orderby' => 'post__in' to the query args in e-picker-query-loop/data.php. post__in is always set for this block (it is a picker), so the setting is unconditional. The webentor/query_loop_args filter can still override orderby per query.

Verification

Picking three posts in a deliberately scrambled order (e.g. A, C, B where publish dates would sort them C, B, A):

  • Before: results render in publish-date order (C > B > A) — picked order ignored
  • After: results render in the picked order (A > C > B) ✅

Confirmed end-to-end on rendered frontend HTML with orderby => 'post__in' applied.

Release prep (0.15.3)

  • package.json + composer.json version bump 0.15.2 → 0.15.3
  • CHANGELOG.md entry
  • docs/src/compatibility-matrix.md row

After merge: push tag core-v0.15.3 to trigger split-webentor-core.yml (mirror + Packagist ping).

https://claude.ai/code/session_01EQPEj5hTGqsPPg2JCu456Q

palicko added 2 commits July 2, 2026 15:38
The Posts Picker Query Loop built its WP_Query with post__in but never
set orderby, so WP_Query fell back to orderby=date DESC and re-sorted the
picked posts by publish date — discarding the editor's hand-picked order
on the frontend. Set orderby => 'post__in' so picked posts render in the
chosen order.

Release prep for webentor-core 0.15.3: version bump (package.json +
composer.json), CHANGELOG entry, compatibility-matrix row.

Claude-Session: https://claude.ai/code/session_01EQPEj5hTGqsPPg2JCu456Q
…tent

This is a public repo. Add an explicit AI Editing Rule: never name a
client/consumer project, its domains, or its data in commits, PRs,
changelogs, comments, or docs. Describe reported bugs generically.

Claude-Session: https://claude.ai/code/session_01EQPEj5hTGqsPPg2JCu456Q
@palicko palicko merged commit 4114a68 into main Jul 2, 2026
6 of 7 checks passed
@palicko palicko deleted the fix/picker-query-loop-orderby branch July 2, 2026 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant