Abilitieseasy-svg-pro/move-icons

easy-svg-pro/move-icons

Move icons into a set or into the icon library.

Ability, Easy SVG Pro, defined in includes/abilities/manage.php

Usage

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

Example

<?php
$ability = wp_get_ability( 'easy-svg-pro/move-icons' );
if ( $ability ) {
	$result = $ability->execute( array(
		'refs' => array(
			'brand/logo',
		),
		'to'   => 'brand',
	) );
}

Description

Moves icons from another set or from the library into an icon set; a library icon goes to the library trash. From a read-only collection they are copied instead. With to set to easy-svg, a set icon moves into the icon library (Easy SVG Pro 1.0.3 and Easy SVG 5.0.3). Pages that call an icon by its old address keep working.

Runs POST /wp-json/easy-svg-pro/v1/library/move 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.

Destructive: it overwrites or removes what is there. Read first, preview where a preview exists.

Parameters

body
refsstring[]

Required. The icons to move, as collection/slug.

body
tostring

Required. The set to move them into, by its collection slug, or easy-svg for the icon library.

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.