Abilitieseasy-svg-pro/relabel-set-icon

easy-svg-pro/relabel-set-icon

Rename an icon in a set.

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

Usage

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

Example

<?php
$ability = wp_get_ability( 'easy-svg-pro/relabel-set-icon' );
if ( $ability ) {
	$result = $ability->execute( array(
		'set_id' => 42,
		'slug'   => 'logo',
		'label'  => 'Brand',
	) );
}

Description

Gives one icon in a set a new label. Its slug never changes.

Runs POST /wp-json/easy-svg-pro/v1/sets/&#123;set_id&#125;/icons/label 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.

Writes to the site. Calling it twice with the same input has the same effect as once.

Parameters

body
set_idinteger

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

body
slugstring

Required. The icon, by its slug in the set. The slug itself never changes.

body
labelstring

Required. Its new name.

Return value

returnarray|WP_Error

What the matching Icons panel screen receives for the same action. An array on success, a WP_Error with the route's code and status on failure.