REST field on enabled post types plus a public get endpoint.
Auth summary
| Access | Surface |
|---|---|
| Public | GET /wp-json/prc-api/v3/art-direction/get/{post_id} |
| Post edit cap | Update art_direction on wp/v2 post routes |
REST field art_direction
Registered on each post type returned by Plugin::get_enabled_post_types().
| Operation | Capability |
|---|---|
| Read | Via standard post REST read rules; get callback runs API->get('all') and migrates legacy social keys |
| Update | current_user_can( 'edit_post', $post->ID ); sanitizes slots; writes meta artDirection |
GET /wp/v2/posts/{id} → response.art_direction
POST /wp/v2/posts/{id} body: { "art_direction": { "A1": { … }, "social": { … } } }
GET /art-direction/get/{post_id}
Namespace: prc-api/v3
Permission: return true (public)
Callback: API( $post_id )->get( 'all' ) — full art direction object, or featured-image fallback when meta is empty.
Request
GET
/wp-json/prc-api/v3/art-direction/get/123
HeadersKey: value
Accept application/json
Response
200 OK
Response headers
Key: value
BodyJSON
{
"A1": {
"id": 456,
"url": "https://example.org/a1.jpg",
"chartArt": false
},
"social": {
"id": 456,
"url": "https://example.org/social.jpg",
"chartArt": false
}
}
Reference
7 fields
Per-slot properties
Typed options, defaults, and constraints in one scannable reference.
-
idnumber -
Attachment ID.
-
rawUrlurl -
Uncropped source URL.
-
urlurl -
Sized URL for the slot.
-
widthnumber -
Width in pixels.
-
heightnumber -
Height in pixels.
-
chartArtboolean -
Light/chart background flag.
-
captionstring -
Optional caption.
No fields match this filter.