Guide

Report Package architecture

Orchestrator: includes/class-plugin.php. Relationship sync: includes/class-relationship-manager.php. REST/meta: includes/class-rest-api.php. Helpers: includes/utils.php.

Meta (on post)

KeyShape
multiSectionReport[{ key, postId }] chapter order (camelCase legacy)
reportMaterials[{ key, type, url, label, attachmentId, icon }]
package_partsTOC groupings { key, label, items[] }
package_parts__enabledBoolean

Do not rename camelCase keys without a migration.

Sync behavior

On parent update/publish: mirror post_status, post_date, and taxonomy terms to chapters (skip no-ops; suppress nested post-publish pipeline during sync). On incremental save: enqueue async reconcile of chapter post_parent (assign listed, clear detached).

Adjacent navigation: filters get_next_post_where / get_previous_post_where for package order.

Blocks

BlockRole
prc-block/report-materialsMaterials list via get_package_materials()
prc-block/report-paginationPagination via get_pagination() / PRC\BlockUtils\Pagination

Distributor (optional)

When distributor_register_data exists, handlers cascade chapters, materials, and parts, remapping IDs; dt_process_distributor_attributes restores post_parent on the target.

Helpers

get_package_id, is_report_package, is_chapter_part_of_report_package, is_part_of_a_report_package, get_package_chapters, get_package_materials, get_pagination in includes/utils.php. Materials pass through filter prc_platform_post_report_package_materials.

Was this helpful?