-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Abilities API: Add the initial core abilities and categories registration. #10411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abilities API: Add the initial core abilities and categories registration. #10411
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe 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
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
There was a problem hiding this 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 👍🏻
tests/phpunit/tests/abilities-api/wpRegisterAbilityCategory.php
Outdated
Show resolved
Hide resolved
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
…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
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:
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.