easy-svg-pro/list-collections
List icon collections.
Ability · Easy SVG Pro · Defined in includes/abilities/manage.php
Usage
wp_get_ability( 'easy-svg-pro/list-collections' )->execute( array $input ): array|WP_Error
Example
<?php
$ability = wp_get_ability( 'easy-svg-pro/list-collections' );
if ( $ability ) {
$result = $ability->execute( array() );
}
Description
Lists every icon collection on this site: the free library, sets, theme folders and registered collections. Each names its origin, how many icons it holds and whether the current user may edit it.
The answer is an overview without the icons themselves and without SVG markup. The icons of a collection come from easy-svg-pro/list-icons, paged and filtered by collection.
Runs GET /wp-json/easy-svg-pro/v1/library/collections through rest_do_request(), so the route's own permission check, argument schema and handler do the work. The ability adds no write path of its own.
Registered while the AI agents (MCP) switch is on, which it is out of the box.
Permission: the user needs manage_options, and every call asks the route's own check again.
Read only: it changes nothing.
Parameters
None. Call it with an empty array.
Return value
An array with collections on success, a WP_Error with the route's code and status on failure. Each collection names id, label, origin, readonly, can_edit, set_id, total (every icon of the collection) and available (the icons that are switched on, which is what list-icons returns). A template set can hold icons that are switched off; available is then lower than total.