Skip to content

Content query: Rename the local date sub-field to site - #1235

Merged
dkotter merged 1 commit into
developfrom
update/content-query-site-dates
Oct 28, 2026
Merged

dkotter merged 1 commit into
developfrom
update/content-query-site-dates

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to #1208. Port of WordPress/wordpress-develop#15000.

This PR syncs core/content-query with the core changes made after r64688:

  • date and modified now return { site, gmt } instead of { local, gmt }. The values are unchanged.
  • The fields input accepts date.site and modified.site. date.local and modified.local are rejected as unknown fields.
  • Core r64690 replaced two loops with array_all() and array_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:

vendor/bin/phpunit --filter '/\\Content(_Rest)?Test::/'

Or run the ability in the editor console:

wp.apiFetch( { path: wp.url.addQueryArgs( '/wp-abilities/v1/abilities/core/content-query/run', { input: { where: { type: 'post' }, fields: [ 'id', 'date', 'modified' ] } } ) } );

Each item should have date and modified objects with site and gmt keys.

Changelog Entry

Changed - The date and modified fields of core/content-query return site and gmt dates instead of local and gmt.

Open WordPress Playground Preview

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.
@jorgefilipecosta
jorgefilipecosta requested a review from a team October 28, 2026 15:33
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

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.

Co-authored-by: jorgefilipecosta <jorgefilipecosta@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>
Co-authored-by: dkotter <dkotter@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@jeffpaul jeffpaul added this to the 1.5.0 milestone Oct 28, 2026
@jeffpaul
jeffpaul requested a review from gziolo October 28, 2026 15:34
@jeffpaul jeffpaul moved this from Triage to Needs review in WordPress AI Roadmap Oct 28, 2026
@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@jeffpaul jeffpaul mentioned this pull request Oct 28, 2026
30 of 46 tasks
@codecov

codecov Bot commented Oct 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.33%. Comparing base (e969443) to head (80c649d).

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           
Flag Coverage Δ
unit 85.33% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gziolo gziolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for syncing it back from WordPress core.

@dkotter
dkotter merged commit 1a58f80 into develop Oct 28, 2026
37 of 38 checks passed
@dkotter
dkotter deleted the update/content-query-site-dates branch October 28, 2026 16:39
@github-project-automation github-project-automation Bot moved this from Needs review to Done in WordPress AI Roadmap Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants