Add args for wp_register_ability() and wp_register_ability_category()#51
Merged
johnbillion merged 2 commits intotrunkfrom Jan 27, 2026
Merged
Add args for wp_register_ability() and wp_register_ability_category()#51johnbillion merged 2 commits intotrunkfrom
wp_register_ability() and wp_register_ability_category()#51johnbillion merged 2 commits intotrunkfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds argument classes for the WordPress Abilities API, specifically for wp_register_ability() and wp_register_ability_category() functions. These classes provide type-safe, autocomplete-friendly argument structures for registering abilities and ability categories in WordPress.
Changes:
- Added argument classes for ability registration functions and their corresponding registry methods
- Enhanced the shape generation script to handle complex types with spaces
- Added comprehensive test files and shape definitions
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/WP_Abilities_Registry.php | Defines arguments for WP_Abilities_Registry::register() method with 9 properties including callbacks, schemas, and metadata |
| src/WP_Ability_Categories_Registry.php | Defines arguments for WP_Ability_Categories_Registry::register() method with label, description, and meta properties |
| src/wp_register_ability.php | Wrapper class for wp_register_ability() function extending WP_Abilities_Registry |
| src/wp_register_ability_category.php | Wrapper class for wp_register_ability_category() function extending WP_Ability_Categories_Registry |
| tests/WP_Abilities_Registry.php | Test file demonstrating usage of WP_Abilities_Registry arguments |
| tests/WP_Ability_Categories_Registry.php | Test file demonstrating usage of WP_Ability_Categories_Registry arguments |
| tests/shapes/WP_Abilities_Registry.txt | Shape definition for WP_Abilities_Registry arguments |
| tests/shapes/WP_Ability_Categories_Registry.txt | Shape definition for WP_Ability_Categories_Registry arguments |
| tests/shapes/wp_register_ability.txt | Shape definition for wp_register_ability arguments |
| tests/shapes/wp_register_ability_category.txt | Shape definition for wp_register_ability_category arguments |
| composer.json | Added shape configuration entries for the new functions and registry methods |
| bin/shapes.php | Enhanced regex pattern to correctly handle type annotations containing spaces |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.