Closed TimVevida closed 4 years ago
@IreneStr any idea when this will be merged?
@alexvandervegt My apologies for this late reply. I've been out of office. I'll make sure a dev will look at this PR this week!
Hi! Sorry for the delay, took me while to understand what exactly is being fixed here. But the auto
mode was indeed broken, and your code fixes it. Thanks!
Acceptance 👍
Summary
Previously, only ACF block which were set to preview mode (the default mode) were communicated to Yoast SEO. However, any block mode can switch to the preview state, either automatically or manually, in the block editor. This patch just checks if such a preview exists, instead of relying on the block being in one of the modes.
This PR can be summarized in the following changelog entry:
Relevant technical choices:
During testing, I found that the order of the content passed to Yoast SEO can vary, blocks in the edit state are added as individual fields earlier in the process. Because the best results are achieved when all blocks are in the preview state, this does not seem a big deal. I do not have enough knowledge of Yoast SEO to know whether this affects SEO scoring. When needed, the fields could be sorted using compareDocumentPosition.
Test instructions
This PR can be tested by following these steps:
preview
,auto
oredit
, see the docs).Fixes #261