Guide

Collections architecture

Maintainer overview of the hybrid post/taxonomy model, term-data-store link, and listing filter.

Objects

ObjectSlugNotes
Post typecollectionsPublic, hierarchical, REST-enabled; archive at /collections/
TaxonomycollectionPublic, hierarchical, REST-enabled; no front-end rewrite archives

Post types that declare prc-collections support (initially post and feature) receive the taxonomy. Extend with add_post_type_support( $type, 'prc-collections' ) or the prc_platform__collections_enabled_post_types filter.

Term data store

On init, the plugin calls \PRC\TDS\add_relationship( 'collections', 'collection', false ). Each collection post maps to a taxonomy term (tds_post_id / tds_term_id). Permalink rewriting from TDS is off; collections own their permalinks.

Meta and Site Editor

MetaTypeRESTPurpose
kicker_pattern_slugstringYesSlug of the kicker-area template part

default_wp_template_part_areas adds a kicker area so kickers are managed separately from general template parts.

Publication listing filter

On pre_get_posts (priority 100), when a publication listing query runs on a collections page, the plugin looks up the related term via \PRC\TDS\get_related_term(), injects a tax_query, and excludes the collection post ID from results.

Blocks

Both blocks register from metadata under src/ and render in PHP:

  • prc-block/collection-kicker — resolves term → kicker_pattern_slugdo_blocks() on the template part; object-cache group prc_collection_kicker (1 hour)
  • prc-block/fact-sheet-collection — builds hierarchy and language links for fact sheets

Editor panel

prc-platform--collections registers a PluginDocumentSettingPanel only on collections posts. Assets build from includes/inspector-sidebar-panel/.

Key files

PathRole
includes/class-content-type.phpCPT, taxonomy, TDS, meta, query filter
includes/class-plugin.phpBootstrap and block load
src/collection-kicker/Kicker block
src/fact-sheet-collection/Fact sheet block
includes/inspector-sidebar-panel/Document settings panel

Was this helpful?