Files
peptide-repo-core/includes/frontend
peptiderepo 077c4b0e51 fix(jsonld): accept string|array @type — v0.6.1
Yoast's wpseo_schema_webpage_type filter passes ['WebPage'] (array) on
every singular page. The v0.6.0 retype_to_medical_webpage() signature
was strict string, causing TypeError → HTTP 500 on ALL singulars under
strict_types=1. Secondary bug: enrich_webpage_piece compared
'WebPage' === $piece['@type'] but @type is an array, so MedicalWebPage
enrichment never injected.

Fix:
- retype_to_medical_webpage: string|array param + return (PHP 8.1+ union)
- enrich_webpage_piece: normalise @type to array before in_array() check
- Add tests/unit/test-jsonld-webpage.php: regression tests with array
  input for both code paths; fail against v0.6.0, pass after fix
- Bump version header + PR_CORE_VERSION constant to 0.6.1
- CHANGELOG entry under [0.6.1]

Agent-Session: jsonld-webpage-typefix v0.6.1
2026-06-13 06:44:00 +00:00
..