Two subsystems load through includes/class-plugin.php.
Subsystems
| Subsystem | Path | Role |
|---|---|---|
| DataCite provider | includes/providers/datacite/class-datacite.php | Post meta, REST field, editor panel enqueue, wp_head JSON-LD |
| DOI Citation block | src/doi-citation/ | Dynamic block that renders the formatted citation |
The inspector sidebar is a separate wp-scripts entry under includes/inspector-sidebar-panel/ and registers as a block editor PluginSidebar. Shared UI lives in shared/citation.jsx.
DataCite to frontend
Meta and REST
On all public post types the plugin registers:
datacite_doi— raw DataCite JSON payloaddatacite_doi_citation— extracted citation string
rest_api_init registers a datacite_doi REST field that returns the formatted plain-text citation. This is a core REST field extension, not a custom route namespace.
JSON-LD output
schema_ld_json() runs on wp_head. It json_decode()s datacite_doi and bails when decoding fails. Output covers singular posts, dataset taxonomy pages, and the dataset post type archive. Dataset taxonomy pages resolve the related post through PRC\TDS\get_related_post().
Block rendering
src/doi-citation/render.php calls Datacite::get_doi_citation(). render_block strips prc-block/doi-citation from core/post-content when is_singular( 'post' ). VIP Block Data API results get the citation injected via vip_block_data_api__sourced_block_result.
Dependencies
- Upstream:
prc-platform-core,prc-staff-bylines,prc-taxonomies/ Term Data Store (prc/term-data-store), VIP Block Data API - Downstream: templates or patterns that place
prc-block/doi-citation; consumers of thedatacite_doiREST field