REST APIeasy-svg-pro/v1/library/index

easy-svg-pro/v1/library/index

Names every icon of every collection the Icons panel lists, without drawings, in a compact form with an ETag.

REST endpoint, Easy SVG Pro, Status: Public, defined in includes/core/library-grid.php

Usage

GET /wp-json/easy-svg-pro/v1/library/index

Example

curl -u admin:app-password -i https://example.com/wp-json/easy-svg-pro/v1/library/index
# Ask again with the ETag of the last answer: 304 when nothing changed
curl -u admin:app-password -i -H 'If-None-Match: "3f2a9c..."' https://example.com/wp-json/easy-svg-pro/v1/library/index

Description

The Icons panel reads this route to list and search everything without loading a single drawing. Each icon is a short list: [slug, label], or [slug, label, 1] when the icon is switched off in its set. A set switched off as a whole is left out. Empty published sets are listed too, so a new set shows before it holds icons; sets only appear while the Collections feature is on. Sets come in the saved order from sets/order.

The answer carries an ETag header and Cache-Control: private, no-cache. A request whose If-None-Match names the current ETag gets 304 with no body. The ETag changes when a set, a folder, a pack plugin or a preset changes. The drawings themselves come from library/markup.

Permission: manage_options and an active license. No feature switch is needed.

Return value

returnWP_REST_Response

format (always compact) and collections, each with id (the collection slug), label, readonly (true for anything that is not a set), set_id (0 when not a set), icons and total. Or 304 with no body.

Response

{
  "format": "compact",
  "collections": [
    {
      "id": "acme",
      "label": "ACME",
      "readonly": false,
      "set_id": 42,
      "icons": [
        ["arrow", "Arrow"],
        ["old-logo", "Old logo", 1]
      ],
      "total": 2
    }
  ]
}