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

easy-svg-pro/v1/library/move

Copies or moves up to 25 icons into a set and rewrites the pages that called a moved icon.

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/library/move

Example

curl -u admin:app-password -H 'Content-Type: application/json' -d '{"refs":["old-set/arrow"],"to":"acme"}' https://example.com/wp-json/easy-svg-pro/v1/library/move

Description

The target must be a set, otherwise 400 easy_svg_pro_not_writable. An icon from another set is moved: every place that called collection/slug is rewritten to the new address, and only when every place was rewritten is it removed from its old set (state moved, else partial). An icon from a read only source such as a folder or the free library is copied. A slug already in the target reports exists. 409 easy_svg_pro_no_hardener when the free plugin is too old. 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

body
refsarray<string>
Required

The icons to move, as collection/slug. Past 25 the rest report over_limit.

body
tostring
Required

The target set, by its collection slug.

Return value

returnWP_REST_Response|WP_Error

set_id of the target set and rows, per ref a state: copied, moved, partial, exists, same, name_clash, no_markup, over_limit or invalid.

Response

set_id of the target set and rows, per ref a state: copied, moved, partial, exists, same, name_clash, no_markup, over_limit or invalid.

{
  "set_id": 42,
  "rows": [
    {
      "ref": "old-set/arrow",
      "state": "moved",
      "to_ref": "acme/arrow",
      "from": "old-set",
      "rewritten": 3
    }
  ]
}
A move rewrites other people's posts that call the icon. Ask /library/usage first to see how many places that is.