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.
Figure out how to filter correctly all abilities when fetching them, given the expected high number of registered items by core and plugins.
Currently, it's only possible to find a single item or fetch all of them:
// Retrieving all abilities.$abilities = wp_get_abilities();
// Retrieving a specific ability.$ability = wp_get_ability( 'example/add-numbers' );
The same applies to the REST API, which offers WP_REST_Abilities_List_Controller that handles listing abilities and retrieving individual abilities:
GET /wp-json/wp/v2/abilities – list all registered abilities.
GET /wp-json/wp/v2/abilities/{name} – Get a specific ability by name.
Let's discuss possible approaches. For reference, the WP Feature API prototype offers a special WP_Feature_Query object that offers several filtering options: