Abilitieseasy-svg-pro/icon-usage

easy-svg-pro/icon-usage

Count where icons are used.

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

Usage

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

Example

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

Description

Counts the posts that still call each icon, before an icon is moved, renamed or deleted.

Runs POST /wp-json/easy-svg-pro/v1/library/usage 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
refsstring[]

Required. Icon addresses, collection/slug, to count the places still calling them.

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.