ralfhortt/query-loop-post-picker
Composer 安装命令:
composer require ralfhortt/query-loop-post-picker
包简介
A WordPress plugin that adds post selection and event date controls to Query blocks.
README 文档
README
Query Loop Post Picker adds editor controls for selecting specific posts and filtering event queries in the WordPress block editor.
Features
- 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.
Requirements
- WordPress 6.1 or newer
- PHP 8.1 or newer
- The WordPress REST API must expose the selected post type.
Installation
- 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.
Development
Install dependencies and build the editor script:
npm install npm run build
For watch mode during development:
npm start
The generated files are written to build/.
Query Attributes
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.
License
GPL-2.0-or-later
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2026-07-13