Guide

Post-like types architecture

Registry, date permalinks, format enforcement, and pipeline opt-in.

Registry

includes/class-registry.php builds labels, calls register_post_type(), attaches taxonomies, and wires shared supports. Concrete types are registered from includes/class-plugin.php before the loader runs.

Base taxonomies for every type: category, collection, formats, languages, research-teams. Each type may add more (see the plugin README table).

Base supports include editor features plus platform supports such as prc-schema-seo, prc-bylines, prc-art-direction, prc-markdown-for-agents, and others. Types with pub_listing also get prc-publication-listing and _post_visibility.

Default CPT links would be /{slug}/{post-name}/. This plugin instead uses /{rewrite-slug}/YYYY/MM/DD/{post-name}/ by:

  1. Adding rewrite rules on init
  2. Filtering post_type_link at priority 30 for published posts

Unpublished posts keep the default URL shape.

Format enforcement

On prc_platform_on_incremental_save, the registry ensures a matching formats term exists and is assigned (creating the term if needed).

Pipeline opt-in

The plugin appends all registered slugs to prc_platform_post_publish_pipeline_post_types so lifecycle hooks fire for these types.

WP-CLI

wp prc templates bulk-update (in includes/class-cli.php) bulk-changes _wp_page_template across a post type. Defaults to dry-run.

Adding a type

Call Registry::register() from class-plugin.php, then flush rewrite rules. See the plugin README for the argument shape.

Was this helpful?