Repository navigation
Content query: Rename the local date sub-field to site - #1235
Conversation
Syncs `core/content-query` with the open WordPress core PR WordPress/wordpress-develop#15000. The `date` and `modified` fields now return `{ site, gmt }`, and the `fields` input accepts `date.site` and `modified.site`. Also marks the two loops that core replaced with `array_all()` and `array_any()` in r64690. The plugin keeps the loops because its WordPress stubs do not declare these functions.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1235 +/- ##
==========================================
Coverage 85.33% 85.33%
Complexity 4424 4424
==========================================
Files 173 173
Lines 16408 16408
==========================================
Hits 14001 14001
Misses 2407 2407
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gziolo
left a comment
There was a problem hiding this comment.
Thank you for syncing it back from WordPress core.
What?
Follow up to #1208. Port of WordPress/wordpress-develop#15000.
This PR syncs
core/content-querywith the core changes made after r64688:dateandmodifiednow return{ site, gmt }instead of{ local, gmt }. The values are unchanged.fieldsinput acceptsdate.siteandmodified.site.date.localandmodified.localare rejected as unknown fields.array_all()andarray_any(). The plugin keeps the loops, because its WordPress stubs do not declare these functions, and marks them with// Plugin:comments.Why?
The plugin should keep behaving like core. The core PR is approved but not committed yet.
How?
includes/Abilities/Content/Content.php: the date sub-field rename and the two// Plugin:notes.ContentTest.php: the core test changes from the PR.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: porting the core change and tests; reviewed by me.
Testing Instructions
Verify unit tests are passing:
Or run the ability in the editor console:
Each item should have
dateandmodifiedobjects withsiteandgmtkeys.Changelog Entry