-
Notifications
You must be signed in to change notification settings - Fork 0
Add new REST API endpoint for Ability Categories #3
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
Conversation
Co-authored-by: Aaron Jorbin <[email protected]>
…stry.php Co-authored-by: Dovid Levine <[email protected]>
…t-controller.php Co-authored-by: Weston Ruter <[email protected]>
…5, as it has no effect
|
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. |
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.
Pull Request Overview
This PR adds a new REST API endpoint for Ability Categories as part of the WordPress Abilities API. It introduces a controller that provides read-only access to ability categories via the /wp/v2/ability-categories endpoint, supporting both collection listing and individual category retrieval.
Key changes include:
- New REST controller for ability categories with pagination support
- Registration of the controller in the WordPress REST API system
- Comprehensive test coverage for the new endpoint
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/phpunit/tests/rest-api/wpRestAbilityCategoriesController.php |
Complete test suite covering all REST API endpoints, permissions, pagination, and error handling |
src/wp-settings.php |
Includes the new controller class file in WordPress core |
src/wp-includes/rest-api/endpoints/class-wp-rest-ability-categories-controller.php |
Main controller implementation with collection and item endpoints |
src/wp-includes/rest-api.php |
Registers the controller routes during REST API initialization |
src/wp-includes/abilities-api/class-wp-ability.php |
Updates @subpackage documentation formatting |
src/wp-includes/abilities-api/class-wp-ability-category.php |
Updates @subpackage documentation formatting |
src/wp-includes/abilities-api/class-wp-ability-categories-registry.php |
Updates @subpackage documentation formatting |
src/wp-includes/abilities-api/class-wp-abilities-registry.php |
Updates @subpackage documentation formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
I opened WordPress#10354 with all changes tested against WordPress
|
bde0aa6 to
755b68b
Compare
3d2c27a to
88b4a6f
Compare
|
Superseeded by WordPress#10380 and commited with 871fd0e. |

Trac ticket: https://core.trac.wordpress.org/ticket/64098
Follow-up for WordPress#9410.
There is also a new REST API endpoint for Ability Categories that I put into this separate PR for transparency.
I transferred it from the Abilities API repository, updating the code based on the feedback in WordPress#9410. Example paths:
GET
/wp/v2/ability-categories- all ability categoriesGET
/wp/v2/ability-categories/test-data-retrieval- a single ability categoryThe name of the controller:
WP_REST_Ability_Categories_Controller.It's very similar in every aspect to the endpoint for listing abilities.
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.