Abilitieseasy-svg-pro/media-markup

easy-svg-pro/media-markup

Read SVGs from the media library.

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

Usage

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

Example

<?php
$ability = wp_get_ability( 'easy-svg-pro/media-markup' );
if ( $ability ) {
	$result = $ability->execute( array(
		'ids' => array(
			42,
		),
	) );
}

Description

Returns the sanitized markup of SVG attachments, ready to add to a set with add-icons-to-set. Writes nothing.

Runs POST /wp-json/easy-svg-pro/v1/media/markup 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
idsinteger[]

Required. Attachment ids of SVGs already in the media 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.