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

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

Removes up to 25 icons from a set by slug and leaves the rest alone.

REST endpoint · Easy SVG Pro · Status: Internal · Defined in includes/core/rest.php

Internal: not part of the promised public surface. It may change without notice.

Usage

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

Example

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

Description

A slug that is not in the set is reported as not_found rather than refusing the whole call, so the others are still removed. The write goes through the same function as every other set write and so fires easy_svg_pro_set_icons_written. Error: 404 easy_svg_pro_no_set. Permission: Requires manage_options, an active licence and the editor feature (Icon set editor) switched on.

Permission: Requires manage_options, an active licence and the editor feature (Icon set editor) switched on.

Parameters

path
idinteger
Required

The icon set post id.

body
slugsarray<string>
Required

Icon slugs to remove, 1 to 25.

Return value

returnWP_REST_Response|WP_Error

The set as it now stands: id, slug, label, icons and report, with state removed or not_found.

Response

The set as it now stands: id, slug, label, icons and report, with state removed or not_found.

{
  "id": 42,
  "slug": "acme",
  "label": "ACME",
  "icons": [],
  "report": [
    {
      "slug": "arrow",
      "state": "removed"
    }
  ]
}
Pages that still call a removed icon render nothing for it. Ask /library/usage first.