Abilitieseasy-svg-pro/list-icons

easy-svg-pro/list-icons

Lists the icons on the site from the free library, Pro collections and published icon sets, paged.

Ability · Easy SVG Pro · Status: Internal · Defined in includes/abilities/abilities.php

Internal: not part of the promised public surface. It may change without notice.

Usage

wp_get_ability( 'easy-svg-pro/list-icons' )->execute( array $input ): array

Example

<?php
$ability = wp_get_ability( 'easy-svg-pro/list-icons' );
if ( $ability ) {
	$result = $ability->execute(
		array(
			'source' => 'set',
			'search' => 'arrow',
		)
	);
}

Description

Each source is only read when it is switched on: the free library when its icons feature is on, collections with the Multiple collections feature, sets with the Icon set editor. Drafts are left out. The set scan stops at 2000 sets and then reports truncated true, so total is a lower bound. Annotated readonly and idempotent, so the REST run endpoint accepts GET. Registered only when the Abilities API exists, the licence is active and the AI agent abilities feature is on. Permission: the user must have manage_options.

Parameters

body
sourcestring

all (default), library, collection or set. An unknown word matches nothing.

body
collectionstring

Restrict the result to one collection or icon set slug.

body
include_markupboolean

Include each icon's sanitized SVG markup. Default false; only a real true counts.

body
pageinteger

Page of results, starting at 1.

body
per_pageinteger

Icons per page, 1 to 500, default 100.

Return value

returnobject

items (slug, label, collection, source, optional markup), total, page, per_page, has_more and truncated.