apply_filters( 'riff_abilities', array[] $abilities )

Filters the abilities Riff registers, so an extension adds its own the way Riff adds its: each the REST route it runs, with what it takes and what it answers. Each is registered in Riff's category, run as a REST request to its route and allowed what the route's own permission callback allows, and offered to an MCP client only where the site turns that on.

Parameters

$abilitiesarray[]
Abilities by name: Riff's own, and any added before.

More Information

Each is keyed by its name, a namespace of the plugin's own, a slash and a name, such as riff-lyrics/set-lyrics, and has a label and a description; the route's method, its namespace (riff/v1 unless given) and its route, with each part the input fills in braces, such as /media/{id}; the input's properties as JSON Schema, each with required where it must be given; the output as JSON Schema; and readonly. It may also have params, a callable that takes the input left after the route's parts and gives the route's parameters, and destructive (default false) and idempotent (default true).

Usage

add_filter( 'riff_abilities', function ( $abilities ) {
	return $abilities;
} );

Source

$all = apply_filters( 'riff_abilities', self::list() );

Changelog

VersionDescription
6.5.0Introduced.