feat: PRAB article JSON-LD emitter + meta reader (v0.8.0) (#25)
prcore emits MedicalWebPage+Article JSON-LD for any post carrying _prab_* meta (ratified contract v1): citation[], about->Drug @ids, honest reviewedBy (Person only with a real human reviewer, else Organization), lastReviewed; integrates into Yoast's graph (no duplicate nodes), standalone @graph fallback; all _prab_* sanitized as untrusted. Unblocks the Phase-2b SEO stage.
QA: REJECT-P1 (DoD doc/test gaps) -> APPROVE @ dbfc50c (qa-reviews/peptide-repo-core/2026-06-23-dbfc50c.md). CEO greenlight 2026-06-22 (complete-all-tasks directive).
Agent-Session: prcore-jsonld-merge-20260623
This commit is contained in:
@@ -61,6 +61,7 @@ $GLOBALS['pr_core_options'] = [];
|
||||
$GLOBALS['pr_core_cron_calls'] = [];
|
||||
$GLOBALS['pr_test_postmeta'] = [];
|
||||
$GLOBALS['pr_test_posts'] = [];
|
||||
$GLOBALS['pr_test_userdata'] = [];
|
||||
$GLOBALS['pr_test_updated_meta'] = [];
|
||||
$GLOBALS['pr_test_is_singular'] = false;
|
||||
$GLOBALS['pr_test_singular_type'] = '';
|
||||
@@ -169,6 +170,11 @@ if ( ! function_exists( 'is_email' ) ) {
|
||||
return (bool) filter_var( $email, FILTER_VALIDATE_EMAIL );
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'wp_parse_url' ) ) {
|
||||
function wp_parse_url( string $url, int $component = -1 ) {
|
||||
return parse_url( $url, $component );
|
||||
}
|
||||
}
|
||||
|
||||
// ── Option / cron stubs ───────────────────────────────────────────────.
|
||||
|
||||
@@ -325,9 +331,28 @@ if ( ! function_exists( 'get_post_modified_time' ) ) {
|
||||
}
|
||||
if ( ! function_exists( 'get_userdata' ) ) {
|
||||
function get_userdata( int $id ) {
|
||||
$data = $GLOBALS['pr_test_userdata'][ $id ] ?? null;
|
||||
if ( null !== $data ) {
|
||||
return $data instanceof WP_User ? $data : new WP_User( (array) $data );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! class_exists( 'WP_User' ) ) {
|
||||
class WP_User {
|
||||
public int $ID = 0;
|
||||
public string $display_name = '';
|
||||
public string $user_login = '';
|
||||
public string $user_email = '';
|
||||
/** @param array<string, mixed> $data */
|
||||
public function __construct( array $data = [] ) {
|
||||
foreach ( $data as $key => $value ) {
|
||||
$this->$key = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'get_author_posts_url' ) ) {
|
||||
function get_author_posts_url( int $id ): string {
|
||||
return 'https://peptiderepo.com/author/' . $id;
|
||||
|
||||
Reference in New Issue
Block a user