Skip to content

Comments

Add args for wp_register_ability() and wp_register_ability_category()#51

Merged
johnbillion merged 2 commits intotrunkfrom
abilities-api
Jan 27, 2026
Merged

Add args for wp_register_ability() and wp_register_ability_category()#51
johnbillion merged 2 commits intotrunkfrom
abilities-api

Conversation

@johnbillion
Copy link
Owner

No description provided.

Copy link
Contributor

Copilot AI left a 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 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.

@johnbillion johnbillion merged commit c1970c5 into trunk Jan 27, 2026
15 checks passed
@johnbillion johnbillion deleted the abilities-api branch January 27, 2026 19:46
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.

1 participant