This PR fixes several issues where the wrong WP globals were used to generate the RankMath <head> metadata and associated fields (like OpenGraph).
Why
The issue manifested itself in several ways:
When querying for a listOf objects, the first object would still be used to determine the Paper() class.
When querying for a connected object type, the parent object would still be used to determine the Paper() class.
When using a nonstandard WP Site URL (e.g frontend.test.test ), the REST API would automatically convert the url front to the backend (e.g. backend.test.test/my-post ), causing an error to be thrown when fetching the fullHead.
closes #19
How
TL;DR instead of using RM's REST route to fetch the head, we're shimming the methods and generating it locally instead.
fix: set object globals for head in Model constructor.
dev: rename Seo::get_rest_url_param() to Seo::get_object_url()
dev: Locally generate instead using RankMath's REST route.
tests: Set category when testing ContentNodeSeoQueryCept so articleMeta.section returns a value.
Testing Instructions
Additional Info
Checklist:
[x] My code is tested to the best of my abilities.
[x] My code follows the WordPress Coding Standards.
[x] My code has proper inline documentation.
[x] I have added unit tests to verify the code works as intended.
[x] The changes in this PR have been noted in CHANGELOG.md
What
This PR fixes several issues where the wrong WP globals were used to generate the RankMath
<head>
metadata and associated fields (like OpenGraph).Why
The issue manifested itself in several ways:
listOf
objects, the first object would still be used to determine thePaper()
class.Paper()
class.frontend.test.test
), the REST API would automatically convert the url front to the backend (e.g.backend.test.test/my-post
), causing an error to be thrown when fetching thefullHead
.closes #19
How
TL;DR instead of using RM's REST route to fetch the head, we're shimming the methods and generating it locally instead.
Seo::get_rest_url_param()
toSeo::get_object_url()
ContentNodeSeoQueryCept
soarticleMeta.section
returns a value.Testing Instructions
Additional Info
Checklist: