Skip to content
This repository was archived by the owner on Feb 5, 2026. It is now read-only.
This repository was archived by the owner on Feb 5, 2026. It is now read-only.

Proposal: Add a convienient way to filter the list of all registered abilities #38

Description

@gziolo

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:

https://github.com/Automattic/wp-feature-api/blob/82ff8af75ab607ec39dfbea3c1100807843922a3/includes/wp-feature.php#L51-L60

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions