REST APIeasy-svg-pro/v1/replace/preview

easy-svg-pro/v1/replace/preview

Lists every post and post meta value that uses one icon, before anything is swapped.

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

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

Usage

POST /wp-json/easy-svg-pro/v1/replace/preview

Example

curl -X POST "https://example.com/wp-json/easy-svg-pro/v1/replace/preview" \
	-H "X-WP-Nonce: $NONCE" -b "$COOKIES" \
	-H "Content-Type: application/json" \
	-d '{"from": "acme/arrow"}'

Description

Searches post content and post meta for the reference in both spellings it can be stored under, with an escaped and an unescaped slash. Each hit names the post, its type and title, where it was found (content or meta:<key>) and how often. At most 500 places are reported; truncated says when there were more.

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

Parameters

body
fromstring
Required

The icon being replaced, as collection/slug.

Return value

returnobject

{from, hits: [{id, type, title, where, count}], truncated}. 400 easy_svg_pro_no_icon for a value that is not a reference.

Response

{from, hits: [{id, type, title, where, count}], truncated}. 400 easy_svg_pro_no_icon for a value that is not a reference.

{
  "from": "acme/arrow",
  "hits": [
    {
      "id": 12,
      "type": "page",
      "title": "Home",
      "where": "content",
      "count": 2
    }
  ],
  "truncated": false
}