REST APIeasy-svg-pro/v1/sets/{id}/icons/off

easy-svg-pro/v1/sets/{id}/icons/off

Switches icons of a set off or on: off icons are no longer offered, pages that already show them keep showing them.

REST endpoint, Easy SVG Pro, Status: Public, defined in includes/core/rest/set-icons.php

Usage

POST /wp-json/easy-svg-pro/v1/sets/{id}/icons/off

Example

curl -u admin:app-password -H 'Content-Type: application/json' -d '{"slugs":["old-logo"],"off":true}' https://example.com/wp-json/easy-svg-pro/v1/sets/42/icons/off

Description

off: true adds the named icons to the set's switched-off list, off: false takes them out. Names the set does not hold are ignored. A switched-off icon stays in the set and keeps rendering where a page already uses it, but the pickers and the Icons panel no longer offer it (library/index marks it with a third value 1). The list is stored in the post meta _easy_svg_pro_hidden, beside the icons, so a preset update rewrites drawings without touching the choice. An unknown set id answers 404 easy_svg_pro_no_set. Send the body as JSON: the callback reads slugs and off from the JSON body.

On the main site of a multisite network, a write that names a set shared with the network answers 403 easy_svg_pro_network_set unless the user has manage_network_options.

Permission: manage_options, an active license, the icon library of the free plugin switched on and the Collections feature (sets) switched on under Settings, Features. WordPress checks the required arguments before the permission callback, so a request without them answers 400, even from a guest.

Parameters

path
idinteger
Required

The icon set post id.

body
slugsarray<string>
Required

The icons, by their slug in the set. 1 to 25.

body
offboolean
Required

true switches them off, false on again.

Return value

returnWP_REST_Response|WP_Error

off, every switched-off icon of the set after the change.

Response

{
  "off": ["old-logo"]
}