PRC Schema - Academic Identity
A plugin for PRC Platform that manages academic identity metadata like DOI, ORCID, etc. This plugin integrates with multiple PRC Platform plugins, including Staff Bylines, Post Like Types, and more.
by Seth Rubenstein · github.com/pewresearch/prc-schema-academic-identity · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/pewresearch/prc-schema-academic-identity/archive/refs/heads/trunk.zipReadme
PRC Schema – Academic Identity
Canonical docs: docs/plugins/prc-schema-academic-identity/
Manages academic identity metadata (DOI, ORCID) for PRC Platform content and outputs Schema.org JSON-LD structured data.
Overview
This plugin integrates with DataCite to attach DOI schema metadata to any public post type. It registers post meta for the raw DataCite JSON payload and the extracted citation ID, exposes both via the REST API, injects Schema.org application/ld+json into wp_head on singular and archive pages, and provides a block editor sidebar panel for editors to enter DOI data. It also ships a prc-block/doi-citation dynamic block that renders a formatted recommended citation on the frontend.
The plugin is part of PRC's Open Science initiative. See the Wiki for background.
Dependencies
- Upstream:
prc-platform-core,prc-staff-bylines,prc-taxonomies(Term Data Store /PRC\TDSfor dataset taxonomy lookups; Composer packageprc/term-data-store), VIP Block Data API (vip_block_data_api__sourced_block_result) - Downstream: Any template or pattern that places the
prc-block/doi-citationblock; any consumer of thedatacite_doiREST field on post objects
Architecture
The plugin loads two parallel subsystems through a central Plugin class:
- DataCite provider (
includes/providers/datacite/class-datacite.php) — owns post meta registration, REST fields, the block editor sidebar panel script, and Schema.org JSON-LD output viawp_head. - DOI Citation block (
src/doi-citation/) — a dynamic block that readsdatacite_doi_citationpost meta and renders a formatted citation paragraph on the frontend. The block is intentionally stripped fromcore/post-contenton singularpostpages and is expected to appear via a template pattern instead.
The inspector sidebar panel is built separately (its own wp-scripts entry point under includes/inspector-sidebar-panel/) and registered as a block editor plugin (PluginSidebar). It shares UI components with the block via shared/citation.jsx.
Key Files
| Path | Purpose |
|---|---|
prc-schema-academic-identity.php |
Plugin entry point; defines constants, bootstraps Plugin class |
includes/class-plugin.php |
Loads dependencies, instantiates providers and blocks |
includes/providers/datacite/class-datacite.php |
Registers datacite_doi / datacite_doi_citation post meta; REST fields; wp_head JSON-LD; editor panel enqueueing |
includes/inspector-sidebar-panel/src/index.js |
Block editor PluginSidebar registration ("Academic Identity") |
includes/inspector-sidebar-panel/src/datacite-doi-schema-panel.jsx |
Panel UI — JSON textarea for raw DataCite payload, live citation preview |
shared/citation.jsx |
Shared Citation component and extractDoiCitation utility (parses JSON-LD, DataCite, and legacy data.id formats) |
src/doi-citation/block.json |
Block metadata — prc-block/doi-citation |
src/doi-citation/edit.jsx |
Block editor view; reads datacite_doi_citation meta via useEntityProp |
src/doi-citation/render.php |
Server-side render; calls Datacite::get_doi_citation() to produce formatted citation HTML |
build/doi-citation/class-doi-citation.php |
Block registration class; hooks render_block and vip_block_data_api__sourced_block_result |
Hooks & Filters
| Hook | Type | Description |
|---|---|---|
init |
action | Registers datacite_doi and datacite_doi_citation post meta on all public post types; registers the prc-block/doi-citation block |
rest_api_init |
action | Registers a datacite_doi REST field on all public post types, returning the formatted plain-text citation string |
enqueue_block_editor_assets |
action | Enqueues the inspector sidebar panel JS on supported post types |
wp_head |
action | Outputs ` |