easy-svg-pro/v1/styles/assign
Gives one style template to many icons at once, or takes it away.
REST endpoint · Easy SVG Pro · Status: Internal · Defined in includes/styles/styles.php
Usage
POST /wp-json/easy-svg-pro/v1/styles/assign
Example
curl -X POST "https://example.com/wp-json/easy-svg-pro/v1/styles/assign" \
-H "X-WP-Nonce: $NONCE" -b "$COOKIES" \
-H "Content-Type: application/json" \
-d '{"icons": ["acme/arrow", "acme/home"], "template": "brand"}'
Description
Each reference is normalised to collection/slug; unknown ones are skipped. An unknown template name, or an empty string, removes the template; an icon left with neither template nor colour mapping is dropped from the assignments. At most 2000 assignments are stored per site.
Permission: manage_options and an active licence with the Styles & theme colors feature switched on under Icons, Features.
Parameters
The icon references to give the template to.
The template name, or an empty string to take the style away.
Return value
The full style settings after the write, same shape as GET /styles.
Response
The full style settings after the write, same shape as GET /styles.
{
"templates": {
"brand": {
"label": "Brand",
"size": 24,
"colour": "primary",
"spacing": 4
}
},
"icons": {
"acme/arrow": {
"template": "brand",
"colours": {}
}
},
"palette": {
"primary": {
"label": "Primary",
"color": "#0a2540"
}
},
"spacing": [
0,
2,
4,
8,
12,
16,
24,
32
],
"registrable": true
}