Develops the Query Filter WordPress plugin (index-powered Query Loop filters, REST renderer, Gutenberg blocks, Interactivity API). Use when editing this repository, adding filter blocks, changing REST or the query engine, or when the user mentions query-filter, Query Loop filtering, or query-filter/v1.
src/ (built to build/): filter-container (parent), checkboxes, radio, dropdown, search, sort, pager, reset. Interactivity store id: query-filter.POST /wp-json/query-filter/v1/results — body parsed by Query_Filter_Request::from_array().| Area | Path |
|---|---|
| Bootstrap | query-filter.php |
| Core PHP | includes/*.php, includes/filters/, includes/sources/ |
| Block source | src/<block-name>/ (block.json, index.js, , , optional ) |
edit.jsrender.phpview.js| Built assets | build/ (gitignored; run build after changing src/) |
| Unit PHPUnit | tests/phpunit/unit/ (default phpunit.xml.dist) |
| Integration PHPUnit | tests/phpunit/integration/ (phpunit-integration.xml.dist, needs WP_TESTS_DIR) |
| Jest | tests/js/ |
| Specs / plans | docs/superpowers/specs/, docs/superpowers/plans/ |
declare(strict_types=1); on new files.[] over array() for literals (match surrounding file).Query_Filter_*, typically final, classmap autoload via composer.json.queryId, pageId, page, orderby, order, search, optional filtersRelationship (AND|OR), filters: legacy name → string[], discrete name → { values, logic }. Action query_filter/indexer/register_filters registers extra Query_Filter_Filter_Checkboxes filters on the indexer.Query_Filter_Query_Engine::get_post_ids( $active_filters, $between_filters_logic = 'AND' ).kind: discrete (values + logic).AND intersects sets; OR unions (combine_post_id_sets())..wp-block-query-filter-filter-checkboxes, .wp-block-query-filter-filter-radio, .wp-block-query-filter-filter-dropdown. Sort: .wp-block-query-filter-filter-sort.search, pg, frel.wp_interactivity_state( 'query-filter', … ) in render.php files.query_filter/blocks/build_directories, query_filter/render/block, query_filter/render/interactivity_context, legacy …/checkboxes/context, query_filter/rest/response — see README. Templates use $block->name, not duplicated constants.Before push, mirror GitHub Actions (.github/workflows/ci.yml):
composer test && composer phpstan && composer lint:php
npm run lint:js && npm run lint:pkg-json && npm run test:unit && npm run build
Quick PHP-only: composer check (PHPStan + PHPCS, no PHPUnit).
Integration suite (full WP): WP_TESTS_DIR=… ./vendor/bin/phpunit -c phpunit-integration.xml.dist when available.
local main without a branch/PR.src/ changes; remind to run npm run build for runtime build/ output.