Query Loop Post Picker adds editor controls for selecting specific posts and filtering event queries in the WordPress block editor.
- Select posts for a Query block with a searchable token field.
- Preserve the selected post order with the Query block's
includeordering. - Filter event queries by a quick date range or custom start dates.
- Show only events related to the current staff member when editing staff templates.
- Loads only in the block editor and uses WordPress core data and components.
- WordPress 6.1 or newer
- PHP 8.1 or newer
- The WordPress REST API must expose the selected post type.
- Download or clone this repository into
wp-content/plugins/query-loop-post-picker. - Run
npm installandnpm run buildif the built assets are not included in your package. - Activate Query Loop Post Picker from the WordPress Plugins screen.
- Add or edit a Query Loop block in the block editor.
The plugin does not add a frontend asset. Its controls are registered through enqueue_block_editor_assets.
Install dependencies and build the editor script:
npm install
npm run buildFor watch mode during development:
npm startThe generated files are written to build/.
The picker writes these attributes to the Query block when applicable:
includeandorderBy: "include"for selected posts.eventDateRangefor a predefined event date range.eventStartAfterandeventStartBeforefor custom event dates.showRelatedEventsOfStafffor staff-related event queries.
The related-events option only appears for event queries in a staff context and is intended to be paired with a server-side query filter that handles this attribute.
GPL-2.0-or-later