Contents
Share Set Usage - Plugixa Easy Social Share Buttons
GET /plugixa-social-share/v1/sets/{id}/usage
The posts that place a share set by hand, through a shortcode, a block or an Elementor widget: what breaks if you delete it.
An account with the plugixa_social_share_view capability. Administrators hold it; no other role does until you grant it.
Posts in any status except the trash are counted, drafts and private posts included. A post that uses a bare [plugixa_share], or a block or widget left on Default, counts for the default set. Automatic placements are not listed here: they are in the set’s own placements.
Request
GET https://your-site.example/wp-json/plugixa-social-share/v1/sets/2/usage
Path parameters
| Name | Type | Description |
|---|---|---|
id |
integer |
The share set’s number, the one typed in [plugixa_share id="2"] |
Responses
200 OK.
{
"success": true,
"data": {
"posts": [
{
"id": 57,
"title": "Tips & Tricks",
"type": "post",
"edit_url": "https://your-site.example/wp-admin/post.php?post=57&action=edit"
}
],
"total": 1,
"capped": false,
"overrides": 0,
"overrides_note": "",
"is_primary": false
}
}
| Field | Type | Meaning |
|---|---|---|
data.posts |
array |
Up to 20 of the posts, each with id, title, type and edit_url |
data.total |
integer |
How many posts use the set, including the ones past the first 20 |
data.capped |
boolean |
true when the search stopped at 1,000 candidate posts, so total may be low |
data.overrides |
integer |
With Pro, how many posts chose this set in their own Share buttons panel PRO. Always 0 on Free |
data.overrides_note |
string |
The same as a sentence to show, empty when overrides is 0 |
data.is_primary |
boolean |
Whether this is the default set |
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 "https://your-site.example/wp-json/plugixa-social-share/v1/sets/2/usage" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-social-share/v1/sets/2/usage');
curl_setopt_array($ch, [
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/usage', {
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share