Contents
On this page
Map Options - Plugixa Image Map
GET /plugixa-image-map/v1/maps/options
A short list of maps to choose from, as the block editor’s map picker uses it: up to 500, sorted by title.
Any signed-in user with WordPress’s edit_posts capability (Contributors and up, by default). No Plugixa Image Map capability is needed.
Note. Drafts are listed only to users with
plugixa_image_map_edit.
Request
GET https://your-site.example/wp-json/plugixa-image-map/v1/maps/options
Responses
200 OK. data holds the maps and a link to create one.
{
"success": true,
"data": {
"maps": [
{
"id": 15,
"title": "Campus map",
"status": "published",
"edit_url": "https://your-site.example/wp-admin/admin.php?page=plugixa-image-map#/maps/15/edit"
},
{
"id": 12,
"title": "Ground floor",
"status": "draft",
"edit_url": "https://your-site.example/wp-admin/admin.php?page=plugixa-image-map#/maps/12/edit"
}
],
"create_url": "https://your-site.example/wp-admin/admin.php?page=plugixa-image-map#/maps"
}
}
| Field | Type | Meaning |
|---|---|---|
data.maps[].id |
integer |
The map’s id, for the shortcode or block |
data.maps[].title |
string |
The title |
data.maps[].status |
string |
published, or draft for users who may edit maps |
data.maps[].edit_url |
string|null |
The map in the editor, null for users who may not edit maps |
data.create_url |
string|null |
The maps screen, null for users who may not create maps |
Maps in the trash are never listed. This list is not paged and takes no parameters.
Errors
Plus the errors every endpoint can return.
Examples
curl -s "https://your-site.example/wp-json/plugixa-image-map/v1/maps/options" \
-u "admin:$WP_APP_PASSWORD"
<?php
$ch = curl_init('https://your-site.example/wp-json/plugixa-image-map/v1/maps/options');
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-image-map/v1/maps/options', {
headers: {
'Authorization': 'Basic ' + btoa(`admin:${process.env.WP_APP_PASSWORD}`),
},
});
const { data } = await response.json();
Quick Links
Share