Slot model, storage, render takeover, and integrations.
Data model
| Item | Value |
|---|---|
| Post meta | artDirection (camelCase object) |
| REST field | art_direction |
| Post type support | prc-art-direction |
| Default enabled type | post |
| Opt-in filter | prc_platform__art_direction_enabled_post_types |
Prefer add_post_type_support( $type, 'prc-art-direction' ) for new types.
Slot schema
Allowed keys: A1, A2, A3, A4, XL, social.
Per slot: id, rawUrl, url, width, height, chartArt, caption.
Legacy facebook / twitter keys migrate to social on REST read/write. WP-CLI: wp prc art-direction migrate-social.
PHP API
\PRC\Platform\Art_Direction\get( $post_id, $size ); // wrapper around API::get()
Instantiate PRC\Platform\Art_Direction\API with a post ID and call ->get( $slot ) or ->get( 'all' ).
Fallback
If artDirection meta is empty but the post has a featured image (_thumbnail_id), the API builds all slots from registered image sizes (A1, A1-HIDPI, A1-SMALL, and peers). Child posts resolve to the parent ID.
core/post-featured-image
block_type_metadata adds attributes:
| Attribute | Type | Default |
|---|---|---|
imageSize | string | A1 |
isChartArt | boolean | false |
render_block replaces frontend output with a responsive <picture> built from art direction data. Missing art data returns the original block content. Editor toolbar exposes sizes A1–A4, XL, and the chart-art toggle.
Integrations
| Integration | Behavior |
|---|---|
| Yoast SEO | wpseo_opengraph_image / wpseo_twitter_image use the social slot when set |
| 10up Distributor | Remaps attachment IDs/URLs per slot when distributor_register_data() exists |
| Attachments panel | Injects Art Direction UI via prc-platform.attachments-panel |
| Schema SEO UI | Injects social slot via prc-platform.seo.ui.social |