Abilitieseasy-svg-pro/preview-bulk-rename

easy-svg-pro/preview-bulk-rename

Preview a bulk rename.

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

Usage

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

Example

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

Description

Shows what a rename rule would make of each icon name, without changing anything.

Runs POST /wp-json/easy-svg-pro/v1/bulk/rename/preview 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.

Read only: it changes nothing.

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.