REST APIeasy-svg/v1/library/rename

easy-svg/v1/library/rename

Changes one icon's visible name and nothing else.

REST endpoint · Easy SVG · Status: Internal · Defined in includes/panel.php

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

Usage

POST /wp-json/easy-svg/v1/library/rename

Example

curl -X POST https://example.com/wp-json/easy-svg/v1/library/rename \
	-H 'Content-Type: application/json' \
	-H 'X-WP-Nonce: <nonce>' \
	-d '{"id":42,"label":"Favourite"}'

Description

The slug stays, because themes and saved Icon blocks reference it. The label is sanitized as text. Errors: 404 easy_svg_no_icon, 422 easy_svg_bad_label for an empty name, 500 easy_svg_rename_failed.

Permission: manage_options (easy_svg_panel_rest_permission)

Parameters

body
idinteger
Required

The icon post id, minimum 1.

body
labelstring
Required

The new visible name.

Response

items (id, slug, label, content), total and truncated. The list is capped at 500 icons.

{
  "items": [
    {
      "id": 42,
      "slug": "heart",
      "label": "Heart",
      "content": "<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 21l-8-8a5 5 0 0 1 8-6 5 5 0 0 1 8 6z"/></svg>"
    }
  ],
  "total": 1,
  "truncated": false
}
The handler reads the JSON body only; send Content-Type: application/json. Values in the query string are ignored by the handler.