Contents
Duplicate Share Set - Plugixa Easy Social Share Buttons
POST /plugixa-social-share/v1/sets/{id}/duplicate
Copy a share set’s networks and look into a new set named “
An account with the plugixa_social_share_edit capability. Administrators hold it; no other role does until you grant it.
The copy has no placements: it appears nowhere until you place it, so the original keeps every spot it had. There is no request body.
Request
POST https://your-site.example/wp-json/plugixa-social-share/v1/sets/2/duplicate
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The share set’s number, the one typed in [plugixa_share id="2"] |
Responses
201 Created. data.item is the copy.
{
"success": true,
"data": {
"item": {
"id": 3,
"name": "Footer row (copy)",
"instance": {
"networks": [
"facebook",
"x",
"copy"
],
"template": "pill",
"layout": "icon",
"align": "start",
"counts": false,
"total": false,
"label": "",
"vertical": false,
"size": "medium",
"size_mobile": "inherit",
"count_pos": "after",
"total_pos": "after",
"more": false,
"color": "",
"ink": ""
},
"placements": {},
"created": 1794478500,
"modified": 1794478500,
"label": "Footer row (copy)"
},
"items": [
{
"id": 1,
"name": "",
"instance": {
"networks": [
"facebook",
"x",
"linkedin",
"whatsapp",
"email",
"copy"
],
"template": "default",
"layout": "full",
"align": "start",
"counts": false,
"total": false,
"label": "",
"vertical": false,
"size": "medium",
"size_mobile": "inherit",
"count_pos": "after",
"total_pos": "after",
"more": false,
"color": "",
"ink": ""
},
"placements": {
"page": {
"content": "content_bottom",
"extra": []
}
},
"created": 1793000000,
"modified": 1794475800,
"label": "Share set 1"
},
{
"id": 2,
"name": "Footer row",
"instance": {
"networks": [
"facebook",
"x",
"copy"
],
"template": "pill",
"layout": "icon",
"align": "start",
"counts": false,
"total": false,
"label": "",
"vertical": false,
"size": "medium",
"size_mobile": "inherit",
"count_pos": "after",
"total_pos": "after",
"more": false,
"color": "",
"ink": ""
},
"placements": {
"post": {
"content": "content_bottom",
"extra": []
}
},
"created": 1794475800,
"modified": 1794475800,
"label": "Footer row"
},
{
"id": 3,
"name": "Footer row (copy)",
"instance": {
"networks": [
"facebook",
"x",
"copy"
],
"template": "pill",
"layout": "icon",
"align": "start",
"counts": false,
"total": false,
"label": "",
"vertical": false,
"size": "medium",
"size_mobile": "inherit",
"count_pos": "after",
"total_pos": "after",
"more": false,
"color": "",
"ink": ""
},
"placements": {},
"created": 1794478500,
"modified": 1794478500,
"label": "Footer row (copy)"
}
],
"primary": 1
}
}
| Field | Type | Meaning |
|---|---|---|
data.item |
object |
The new set, with the fields of Get Share Set and empty placements |
data.items |
array |
Every share set as it now stands, lowest number first |
data.primary |
integer |
The default set: the lowest number that exists, 0 when there are none |
Errors
| Status | Code | When |
|---|---|---|
404 |
plugixa_social_share_not_found |
No share set with that number. It may have been deleted. |
Plus the errors every endpoint can return.
Examples
curl -s -X POST "https://your-site.example/wp-json/plugixa-social-share/v1/sets/2/duplicate" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-social-share/v1/sets/2/duplicate');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_USERPWD => 'admin:' . getenv('WP_APP_PASSWORD'),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
const response = await fetch('https://your-site.example/wp-json/plugixa-social-share/v1/sets/2/duplicate', {
method: 'POST',
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share