Skip to content

Add query presets feature#6

Open
roborourke wants to merge 3 commits intomainfrom
claude/refactor-rest-controllers-uma3x
Open

Add query presets feature#6
roborourke wants to merge 3 commits intomainfrom
claude/refactor-rest-controllers-uma3x

Conversation

@roborourke
Copy link
Collaborator

Fixes #5

@github-actions
Copy link

github-actions bot commented Jan 23, 2026

Playwright test results

failed  4 failed
passed  10 passed

Details

stats  14 tests across 4 suites
duration  3 minutes, 52 seconds
commit  51b2424

Failed tests

chromium › query-presets.spec.js › Query Presets › should show query preset dropdown when presets are registered
chromium › query-presets.spec.js › Query Presets › should change post order when selecting alphabetical preset in editor
chromium › query-presets.spec.js › Query Presets › should change post order when selecting Z-A preset in editor
chromium › query-presets.spec.js › Query Presets › should apply query preset on frontend

Implements a PHP API for registering custom query presets that can be
selected in the block editor and applied on both frontend and REST API
requests. Key features:

- register_query_preset() function for registering custom queries with
  name, label, and callback
- Dynamic REST API hooks for all public post types via
  rest_{$post_type}_collection_params and rest_{$post_type}_query
- Frontend query filtering via query_loop_block_query_vars
- Dropdown selector in the Query Loop block's Extra Settings panel
- Preset selection stored in query.hmPreset block attribute

Resolves #5

https://claude.ai/code/session_018FFsVSfGCZEyNTYDo8ymaq
Documents the new Query Presets feature including:
- Feature overview in the Features section
- Usage instructions for the dropdown selector
- Developer documentation with code examples
- Available PHP functions for preset management

https://claude.ai/code/session_018FFsVSfGCZEyNTYDo8ymaq
- Add test mu-plugin with sample presets (alphabetical ordering)
- Update .wp-env.json to mount mu-plugins folder for tests
- Add query-presets.spec.js with tests for:
  - Preset dropdown visibility when presets are registered
  - Post ordering changes when selecting A-Z preset
  - Post ordering changes when selecting Z-A preset
  - Frontend query preset application

https://claude.ai/code/session_018FFsVSfGCZEyNTYDo8ymaq
@roborourke roborourke force-pushed the claude/refactor-rest-controllers-uma3x branch from 3a4fb5b to 51b2424 Compare January 27, 2026 09:51
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.

Feature: Predefined queries selector

2 participants