Skip to content

Abilities API: Rename the local date sub-field of core/content-query to site - #15000

Closed
jorgefilipecosta wants to merge 2 commits into
WordPress:trunkfrom
jorgefilipecosta:update/content-query-site-dates
Closed

jorgefilipecosta wants to merge 2 commits into
WordPress:trunkfrom
jorgefilipecosta:update/content-query-site-dates

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Follow up to https://core.trac.wordpress.org/changeset/64388.

This PR renames the local sub-field of the core/content-query date fields to site:

  • 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.
  • Tests updated, plus coverage for the site, gmt order.

Trac ticket: https://core.trac.wordpress.org/ticket/66268

Testing

Verify unit tests are passing:

vendor/bin/phpunit tests/phpunit/tests/abilities-api/wpRegisterCoreContentAbility.php

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.

AI disclosure: the change and tests were drafted with AI assistance (Claude Code) and reviewed by me.

@github-actions

github-actions Bot commented Oct 27, 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.

Core Committers: Use this line as a base for the props when committing in SVN:

Props jorgefilipecosta, gziolo.

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.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@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.

Thanks for this, the rename looks good! One small suggestion: I would drop the date.local and modified.local cases from data_unknown_field_paths(). These names never shipped in a release, and the bogus_field case already covers the same validation. Keeping the original single test is simpler, and it doesn't keep the old name around in the tests.

@jorgefilipecosta

Copy link
Copy Markdown
Member Author

Hi @gziolo, thank you for the review! The suggestion was applied, the unknown field test is back to the single bogus_field case.

@jorgefilipecosta
jorgefilipecosta force-pushed the update/content-query-site-dates branch from 4a6528c to 1d40d0c Compare October 28, 2026 15:06
…ry` to `site`.

The `date` and `modified` fields of a `core/content-query` post now return the date in the site's timezone as `site` instead of `local`, next to `gmt`. The `date.local` and `modified.local` field paths are no longer accepted.

Follow-up to [64388].

See #66268.
…uery`.

The `local` date sub-field paths never shipped in a release, and the `bogus_field` case already covers the unknown field validation.
@jorgefilipecosta
jorgefilipecosta force-pushed the update/content-query-site-dates branch from 1d40d0c to e0f5674 Compare October 28, 2026 15:24
wporg-sync pushed a commit that referenced this pull request Oct 28, 2026
…ry` to `site`.

The `date` and `modified` fields now return `site` and `gmt` sub-fields, and the `fields` input accepts `date.site` and `modified.site`.

Developed in #15000.
Follow-up to r64388.

Props jorgefilipecosta, gziolo.
See #66268.

git-svn-id: https://develop.svn.wordpress.org/trunk@64907 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Oct 28, 2026
…ry` to `site`.

The `date` and `modified` fields now return `site` and `gmt` sub-fields, and the `fields` input accepts `date.site` and `modified.site`.

Developed in WordPress/wordpress-develop#15000.
Follow-up to r64388.

Props jorgefilipecosta, gziolo.
See #66268.
Built from https://develop.svn.wordpress.org/trunk@64907


git-svn-id: http://core.svn.wordpress.org/trunk@64057 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants