Add Site Metadata Endpoint and API Key Management
- Introduced a new Site Metadata endpoint (`GET /wp-json/igny8/v1/site-metadata/`) for retrieving available post types and taxonomies, including counts. - Added API key input in the admin settings for authentication, with secure storage and revocation functionality. - Implemented a toggle for enabling/disabling two-way sync operations. - Updated documentation to reflect new features and usage examples. - Enhanced permission checks for REST API calls to ensure secure access.
This commit is contained in:
@@ -249,6 +249,35 @@ $result = $integration->full_site_scan();
|
||||
- `igny8_send_site_data_to_igny8($site_id)` - Send site data to IGNY8
|
||||
- `igny8_map_site_to_semantic_strategy($site_id, $site_data)` - Map to semantic structure
|
||||
|
||||
### Site Metadata Endpoint (Plugin)
|
||||
|
||||
The plugin exposes a discovery endpoint that your IGNY8 app can call to learn which WordPress post types and taxonomies exist and how many items each contains.
|
||||
|
||||
- Endpoint: `GET /wp-json/igny8/v1/site-metadata/`
|
||||
- Auth: Plugin-level connection must be enabled and authenticated (plugin accepts stored API key or access token)
|
||||
- Response: IGNY8 unified response format (`success`, `data`, `message`, `request_id`)
|
||||
|
||||
Example response:
|
||||
|
||||
```json
|
||||
{
|
||||
"success": true,
|
||||
"data": {
|
||||
"post_types": {
|
||||
"post": { "label": "Posts", "count": 123 },
|
||||
"page": { "label": "Pages", "count": 12 }
|
||||
},
|
||||
"taxonomies": {
|
||||
"category": { "label": "Categories", "count": 25 },
|
||||
"post_tag": { "label": "Tags", "count": 102 }
|
||||
},
|
||||
"generated_at": 1700553600
|
||||
},
|
||||
"message": "Site metadata retrieved",
|
||||
"request_id": "550e8400-e29b-41d4-a716-446655440000"
|
||||
}
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File Structure
|
||||
|
||||
Reference in New Issue
Block a user