Skip to content

Conversation

@jorgefilipecosta
Copy link
Member

@jorgefilipecosta jorgefilipecosta commented Oct 24, 2025

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

Backports the initial WordPress core abilities proposed at WordPress/abilities-api#108 with improvements in preparation for core at WordPress/abilities-api#128, into Core WordPress.

Testing

Verify the unit tests are passing.
Loaded the block editor, oppened the browser console, exectuted the following two calls:

wp.apiFetch({ path: wp.url.addQueryArgs('/wp-abilities/v1/abilities/core/get-site-info/run' ) } ).then(console.log);
wp.apiFetch({ path: wp.url.addQueryArgs('/wp-abilities/v1/abilities/core/get-site-info/run', {input: {fields: ['name','url' ] } } ) } ).then(console.log);

Verified things returned as expected.

This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@jorgefilipecosta jorgefilipecosta marked this pull request as ready for review October 24, 2025 09:12
@github-actions
Copy link

github-actions bot commented Oct 24, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

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

Props jorgefilipecosta, gziolo, mukesh27.

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

@github-actions
Copy link

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

  • The Plugin and Theme Directories cannot be accessed within Playground.
  • 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.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Nice one, thank you for working on syncing this code from Abilities API repository. I see you applied the feedback from @aaronjorbin regarding how the code is structured 👍🏻

jorgefilipecosta and others added 13 commits October 24, 2025 16:22
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
Co-authored-by: Greg Ziółkowski <grzegorz@gziolo.pl>
- Modified tests/phpunit/includes/functions.php to unhook core abilities at priority 1 (before registration) instead of priority 1000 (after)
- Updated tests/phpunit/tests/abilities-api/wpCoreAbilities.php to use set_up_before_class() for one-time core abilities registration
- All 239 abilities API tests now pass (565 assertions)
- Minimal test-specific code required
pento pushed a commit that referenced this pull request Oct 26, 2025
…tion.

Without this patch we would introduce the Abilities API without any core abilities being registered.
This patch includes the following initial abilities:
- core/get-bloginfo - Retrieve individual site information fields (name, description, url, wpurl, admin_email, charset, language, version).
- core/get-current-user-info - Get current authenticated user data (id, display_name, user_nicename, user_login, roles, locale).
- core/get-environment-type - Get WordPress environment type (production, staging, development, local).

Developed in #10411.

Follow-up [64098].

Props gziolo, jorgefilipecosta, mukesh27, isotropic, jorbin, justlevine, jason_the_adams.
Fixes #64146.

git-svn-id: https://develop.svn.wordpress.org/trunk@61063 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions
Copy link

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 61063
GitHub commit: 9824c6f

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

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.

3 participants