REST APIeasy-svg-pro/v1/history/restore

easy-svg-pro/v1/history/restore

Puts one icon of an icon set back to an earlier version.

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

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

Usage

POST /wp-json/easy-svg-pro/v1/history/restore

Example

curl -X POST "https://example.com/wp-json/easy-svg-pro/v1/history/restore" \
	-H "X-WP-Nonce: $NONCE" -b "$COOKIES" \
	-H "Content-Type: application/json" \
	-d '{"set": 42, "version": 311, "icon": "arrow"}'

Description

The revision must be a revision of that set, otherwise 400 easy_svg_pro_wrong_version, so no version id from elsewhere on the site can be read as a snapshot. Only the chosen icon is restored, the rest of the set stays as it is, and the drawing passes the sanitizer again before the shared set write stores it.

Permission: manage_options and an active licence with the Icon history feature switched on under Icons, Features.

Parameters

body
setinteger
Required

The icon set holding the icon.

body
versioninteger
Required

The revision id to put back.

body
iconstring
Required

The icon slug to restore. Its name never changes.

Return value

returnobject

{state, icon, message}. state is restored or the reason it was not (for example refused_sanitiser). 400 easy_svg_pro_bad_restore when a field is missing, 409 easy_svg_pro_no_sanitizer without the free plugin.

Response

{state, icon, message}. state is restored or the reason it was not (for example refused_sanitiser). 400 easy_svg_pro_bad_restore when a field is missing, 409 easy_svg_pro_no_sanitizer without the free plugin.

{
  "state": "restored",
  "icon": "arrow",
  "message": "..."
}