You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
I left a note here about making execute_callback optional when ability_class is passed as one of the properties:
invoke on Content_Rewrite_Tool would have to be static to fit here because execute_callback is mandatory at the moment during ability registration (label and description, too). If that is too limiting, we could revisit $properties validation. I also think that we should make $properties mandatory, as you still must provide these 3 properties, so validation passes before the ability instance gets created.
It's where not only the execute_callback was mocked, but also the description.
Proposal
Make $properties mandatory.
Make execute_callback optional when ability_class gets passed.
Consider making label and description optional when ability_class gets passed, with the assumption that the developer will set it in the custom class extending WP_Ability.
I left a note here about making
execute_callbackoptional whenability_classis passed as one of the properties:I have an example from @felixarntz of using
ability_classfrom the AI chatbot demo using the PHP AI Client SDK presented at WC US:https://github.com/felixarntz/wp-ai-sdk-chatbot-demo/blob/326266fd62fc805ceac0dfd4fe71cd3cc3e7cad3/includes/Abilities/Abilities_Registrar.php#L26-L44
It's where not only the
execute_callbackwas mocked, but also the description.Proposal
$propertiesmandatory.execute_callbackoptional whenability_classgets passed.labelanddescriptionoptional whenability_classgets passed, with the assumption that the developer will set it in the custom class extendingWP_Ability.