Guide

Revisions architecture

Core wiring: includes/class-plugin.php with prc-revisions post type support on post and page (priority 5). Chart CPT opts in from Chart Builder.

Modules

ClassRole
Public_RevisionsPublic meta, /version/{letter} content substitution, delete protection
Future_RevisionsFork create/merge/discard, fork meta, listing exclusion
Rest_APIToggle, fork, public-revisions, fork-info
Rewriteversion rewrite endpoint on EP_PERMALINK
Schemaprc-schema-seo version / isBasedOn / hasPart
WP_AdminEditor sidebar enqueue
DataViews_ProviderAll Posts STATUS badges for fork and parent rows

Block: prc-revisions/list in src/revision-list/.

Meta

KeyOnPurpose
_prc_public_revisionsParent[{ version, revision_id }]
_prc_fork_parentForkParent post ID
_prc_fork_statusForkdraft, pending_review, or merged
_prc_active_forkParentEnforces one active fork

DataViews list rows add futureRevision: { role, label } from get_fork_info() via DataViews_Provider::indicator_from_fork_info(). Fork drafts get Future Revision. Parents with a pending fork get Has Future Revision.

Fork merge

On prc_platform_on_publish (priority 5), Future_Revisions::merge_fork() copies meta/taxonomies to parent, updates title/content/excerpt, re-parents attachments and children, fires revision_applied, marks merged, trashes fork. Failure reverts the fork to draft.

Enabling other post types

add_action( 'init', function () {
	add_post_type_support( 'my-post-type', 'prc-revisions' );
} );

Plugin::get_enabled_post_types() drives fork meta registration and write checks.

Was this helpful?