easy-svg-pro/add-icons-to-set
Adds icons to an existing icon set without touching the icons already in it.
Ability · Easy SVG Pro · Status: Internal · Defined in includes/abilities/abilities.php
Usage
wp_get_ability( 'easy-svg-pro/add-icons-to-set' )->execute( array $input ): array|WP_Error
Example
<?php
$ability = wp_get_ability( 'easy-svg-pro/add-icons-to-set' );
if ( $ability ) {
$result = $ability->execute(
array(
'set_id' => 42,
'icons' => array(
'arrow' => array(
'label' => 'Arrow',
'markup' => '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 12h16"/></svg>',
),
),
)
);
}
Description
Runs the same path as POST /sets/{id}/icons/add: every icon is sanitized and hardened, merged against what is stored, and a name already in the set is reported as exists instead of being overwritten. Needs the Icon set editor feature too, else easy_svg_pro_no_editor (409). Fires easy_svg_pro_set_icons_written through the shared write. Registered only when the Abilities API exists, the licence is active and the AI agent abilities feature is on. Permission: the user must have manage_options.
Parameters
Required. The icon set post id to add to.
Required. Icons keyed by name, each value with label and markup.
Return value
set_id, slug (the registered collection slug) and report, one row per icon with state added or exists.