Abilitieseasy-svg-pro/bulk-rename

easy-svg-pro/bulk-rename

Rename many icons.

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

Usage

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

Example

<?php
$ability = wp_get_ability( 'easy-svg-pro/bulk-rename' );
if ( $ability ) {
	$result = $ability->execute( array(
		'icons' => array(
			'brand/logo',
		),
		'rule'  => array(
			'find'    => '-outline',
			'replace' => '',
		),
	) );
}

Description

Renames many icons by one rule. A rename reaches every page naming the icon, so preview it first. In the report, the state rename means the icon was renamed.

Runs POST /wp-json/easy-svg-pro/v1/bulk/rename 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. Bulk editing has no switch of its own: it is on while the license is active and the free icon library is 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
iconsstring[]

Required. The icon references to act on, as collection/slug.

body
ruleobject|array

Required. find, replace, prefix and suffix. Plain text, never a pattern.

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.