Guide

Print Engine architecture

Print URL serving, PDF export pipeline, and block registry.

Soft dependencies

Guarded at call sites; the plugin boots without them:

  • prc-firebase — OIDC for Cloud Function calls
  • prc-report-package — multi-chapter assembly
  • prc-staff-bylines / prc-schema-seo — cover content
  • prc-chart-builder — chart print callbacks
  • Action Scheduler — async PDF jobs (via post-publish-pipeline)
  • prc-scripts — required

Browser /print and discovery links require a logged-in user (staff-beta). Server-side PDF generation does not use a WP session. Firebase fetches /print with a short-lived, post-bound machine-fetch ticket minted by the access layer.

Eligibility for automatic PDF generation (Pdf_Export::can_generate_for_post): published, not password-protected, post type supports prc-print-engine, and print serving is allowed for that post.

PDF pipeline

On prc_platform_async_on_publish / prc_platform_async_on_update, eligible posts enqueue Action Scheduler action prc_print_engine_generate_pdf. The job calls Firebase generatePdf, then stores a media attachment on the owner post.

Post metaMeaning
_print_engine_pdf_attachment_idAttachment ID
_print_engine_pdf_urlPublic PDF URL
_print_engine_content_hashContent hash for change detection
_print_engine_pdf_generated_atGeneration timestamp
Flow

PDF generation

4 relationships
Async tier owns server-side PDF export.

Block registry

prc_print_engine_register_block_callbacks fires at init. Plugins register print markup and styles via Block_Print_Registry::register(). Editor Block Visibility uses setting slug print_engine.

Firebase render function URLs resolve through client-mu-plugins/firebase-render.php (prc_platform_firebase_render_endpoints).

Was this helpful?