Abilitieseasy-svg-pro/get-set

easy-svg-pro/get-set

Read one icon set.

Ability · Easy SVG Pro · Defined in includes/abilities/manage.php

Usage

wp_get_ability( 'easy-svg-pro/get-set' )->execute( array $input ): array|WP_Error

Example

<?php
$ability = wp_get_ability( 'easy-svg-pro/get-set' );
if ( $ability ) {
	$result = $ability->execute( array(
		'set_id' => 42,
	) );
}

Description

Returns one icon set with its icons: slug, label, keywords and markup, one page at a time. total and has_more say whether there are more pages.

save-set replaces the whole set. Change single icons of a large set with add-icons-to-set, relabel-set-icon and remove-icon-from-set, not with one page you read and save-set.

Runs GET /wp-json/easy-svg-pro/v1/sets/&#123;set_id&#125; 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 and the Collections feature are on. Permission: the user needs manage_options, and every call asks the route's own check again.

Read only: it changes nothing.

Parameters

body
set_idinteger

Required. The icon set post id. At least 1.

body
pageinteger

Optional. Which page of icons to return, starting at 1. Default 1.

body
per_pageinteger

Optional. How many icons one page holds. Default 100, at most 500.

Return value

returnarray|WP_Error

An array on success, a WP_Error with the route's code and status on failure. Beside id, slug, label and hash it holds icons (the icons of this page), total, page, per_page and has_more.