Skip to content

Users query: Return the registration date as registered.site and registered.gmt - #1237

Merged
jeffpaul merged 2 commits into
developfrom
update/users-query-registered-dates
Oct 28, 2026
Merged

jeffpaul merged 2 commits into
developfrom
update/users-query-registered-dates

Conversation

@jorgefilipecosta

@jorgefilipecosta jorgefilipecosta commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What?

Follow up to #1207. Port of WordPress/wordpress-develop#15001.

This PR syncs core/users-query with the core changes made after the last sync:

  • registered_date is replaced by a registered object with { site, gmt }: the registration date in the site's timezone and in GMT. Each is null when the stored date is not a valid date.
  • The fields input accepts registered.site and registered.gmt to select a single date. registered_date is rejected as an unknown field.
  • user_registered is now always read as UTC, whatever the PHP default timezone is.
  • Core r64850 unregisters the test post types after each test. The plugin does it in the existing tearDown().

Why?

The plugin should keep behaving like core, and registered uses the same { site, gmt } shape as the core/content-query dates in #1235. The core PR is approved but not committed yet.

How?

  • includes/Abilities/Users/Users.php: the core changes, with the ai text domain and a DateTimeZone import.
  • UsersTest.php: the core test changes.

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 '/\\Users(_Rest)?Test::/'

Or run the ability in the editor console:

wp.apiFetch( { path: wp.url.addQueryArgs( '/wp-abilities/v1/abilities/core/users-query/run', { input: { fields: [ 'id', 'registered' ] } } ) } );

Each item should have a registered object with site and gmt keys.

Changelog Entry

Changed - The registered_date field of core/users-query is replaced by a registered object with site and gmt dates.

Open WordPress Playground Preview

@jorgefilipecosta
jorgefilipecosta requested a review from a team October 28, 2026 16:11
@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: jeffpaul <jeffpaul@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.

@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

@codecov

codecov Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.52941% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.34%. Comparing base (1a58f80) to head (6c1b6e8).

Files with missing lines Patch % Lines
includes/Abilities/Users/Users.php 98.52% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #1237      +/-   ##
=============================================
+ Coverage      85.33%   85.34%   +0.01%     
- Complexity      4424     4431       +7     
=============================================
  Files            173      173              
  Lines          16408    16435      +27     
=============================================
+ Hits           14001    14027      +26     
- Misses          2407     2408       +1     
Flag Coverage Δ
unit 85.34% <98.52%> (+0.01%) ⬆️

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 bringing it over from WP core 💯

@jeffpaul jeffpaul added this to the 1.5.0 milestone Oct 28, 2026
@jeffpaul
jeffpaul enabled auto-merge (squash) October 28, 2026 18:43
@jeffpaul jeffpaul mentioned this pull request Oct 28, 2026
30 of 46 tasks

@dkotter dkotter left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Changes look fine to me.

Noting it came up on the AI call today that these schema changes (there's been a few PRs now with them) technically break backwards compat, if anyone happened to be using these abilities with the old schema.

I'm personally okay with that, as these are gated behind an experiment and we don't claim to support experiments in a backward compat manner but curious if anyone else has differing thoughts here? At the very least, need to make it clear in the changelog that any schema changes to existing abilities (introduced in v1.4.0 or less) will need downstream updates if being used directly.

cc / @jeffpaul @jorgefilipecosta @gziolo

@jeffpaul
jeffpaul merged commit 4d1940a into develop Oct 28, 2026
37 of 69 checks passed
@jeffpaul
jeffpaul deleted the update/users-query-registered-dates branch October 28, 2026 19:11
@gziolo

gziolo commented Oct 29, 2026

Copy link
Copy Markdown
Member

Let's make it clear in the changelog and release notes that all 3 core abilities have now identical shape like these shipping in WordPress 7.2, which required breaking changes to support all feedback shared during development and testing.

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.

4 participants