Content types, resolve rules, caching, and context injection.
Content model
block_module (CPT, show_in_rest)
├── block_area (hierarchical taxonomy, show_in_rest)
├── category / regions-countries / collection / prc_newsletter_list
└── _story_item_ids (post meta + REST field)
block_module supports title, editor, excerpt, author, custom-fields, revisions. Rewrite slug: block-module.
On save, the plugin indexes prc-block/story-item post IDs into _story_item_ids and fires prc_platform_on_block_module_update (re-index + cache bust).
Resolve rules
A prc-platform/block-area block renders the matching block_module when:
block_areaterm slug equalsblockAreaSlug, and- Optional scoping taxonomy term equals
taxonomyTermSlug, or the queried term wheninheritTermFromTemplateis true
Or when ref is set to a module post ID (bypass taxonomy lookup).
Non-menu block areas return no content on paged requests (is_paged()). The Interactivity API store prc-platform/block-area mirrors that on the frontend.
Context provider
prc-platform/block-area-context-provider:
render_block_contextpriority 1 — find nested block area, load_story_item_idsinto a collector (object-cached)- Priority 100 — merge IDs into
core/post-templatecontext asquery.post__not_in pre_get_posts— on category archive main queries (non-front, non-paged, not blog_id 1), excludetopic-ledestory items
Cache
| Detail | Value |
|---|---|
| Groups | prc_block_area_module_story_item_ids, prc_block_area_module_id |
| Keying | md5( json( [ blockAreaSlug, categorySlug ] ) ) style combinations |
| TTL | 1 hour |
| Bust | Saving a block_module deletes its entry |
REST
No custom register_rest_route. Consumers use CPT REST for block_module / block_area plus the _story_item_ids REST field.