Skip to content

Add query presets feature#6

Merged
roborourke merged 5 commits intomainfrom
claude/refactor-rest-controllers-uma3x
Apr 8, 2026
Merged

Add query presets feature#6
roborourke merged 5 commits intomainfrom
claude/refactor-rest-controllers-uma3x

Conversation

@roborourke
Copy link
Copy Markdown
Collaborator

Fixes #5

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 23, 2026

Playwright test results

passed  16 passed

Details

stats  16 tests across 5 suites
duration  54.5 seconds
commit  a84bd96

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
roborourke and others added 2 commits April 8, 2026 13:42
Replace fragile parent-traversal select locators and invalid :near()
pseudo-class with page.getByRole('combobox') across all tests. Rewrite
the frontend test to use editor.insertBlock() with explicit inner blocks
instead of the WP 6.9-incompatible block inserter UI interaction.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Matches convention used in other test files in the project.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@roborourke roborourke merged commit fe76a39 into main Apr 8, 2026
1 check passed
@roborourke roborourke deleted the claude/refactor-rest-controllers-uma3x branch April 8, 2026 13:34
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