Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/horttcore/query-loop-date-query/archive/refs/heads/main.zipOn Packagist as ralfhortt/query-loop-date-query:
composer require ralfhortt/query-loop-date-queryNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Adds publish-date range controls to Query Loop (core/query) blocks in the block editor and applies the same filters on the frontend and in the editor preview (REST).
Features
- Quick ranges: last 30 days, last 3 months, last 12 months, this year (site timezone).
- Custom inclusive publish-date from / until fields.
- Skips inherited template queries (
query.inherit). - REST collection params for accurate editor previews (
published_after,published_before,published_date_range).
Requirements
- WordPress 6.1+
- PHP 8.1+
Development
npm install
npm run build
Query attributes
Stored on attributes.query:
publishedDateRangepublishedAfterpublishedBefore
REST preview also uses snake_case keys (published_date_range, published_after, published_before) synced by the editor script.
Filter
query_loop_date_query_range— adjust resolved{ after, before }bounds (Y-m-d) before applyingdate_query.
License
GPL-2.0-or-later
Translations
German (de_DE): languages/query-loop-date-query-de_DE.po. After changing JS strings, run npm run build, then:
msgfmt -o languages/query-loop-date-query-de_DE.mo languages/query-loop-date-query-de_DE.po
wp i18n make-json languages --no-purge