| @@ -1239,12 +1239,19 @@ | ||
| 1239 | 1239 | $og_image = Metasync_Seo_Precedence::value($post->ID, Metasync_Seo_Precedence::FIELD_OG_IMAGE) |
| 1240 | 1240 | ?: $this->get_featured_image_url($post->ID); |
| 1241 | 1241 | $canonical_override = ''; |
| 1242 | 1242 | if (class_exists('Metasync_Headless_Config') && Metasync_Headless_Config::is_active()) { |
| 1243 | - # The same two-key chain the canonical tag itself resolves, so the | |
| 1244 | - # two cannot disagree. meta_canonical is not a legacy alias: the | |
| 1245 | - # REST sync and the classic-editor Canonical box both still write | |
| 1246 | - # it, and the GraphQL surface reads both keys as well. | |
| 1243 | + # The two manual keys of the canonical chain, in the same order the | |
| 1244 | + # canonical tag resolves them. OTTO's volatile staging tier is | |
| 1245 | + # deliberately left out: headless rehosts derived WordPress URLs, | |
| 1246 | + # and an OTTO suggestion is not the author's answer about where | |
| 1247 | + # content lives — a staged cross-domain canonical must not flow | |
| 1248 | + # into headless og:url. The two can therefore disagree with the | |
| 1249 | + # WordPress-render canonical tag only when OTTO is staging a | |
| 1250 | + # canonical and no manual value exists; that is the documented | |
| 1251 | + # scope split. meta_canonical is not a legacy alias: the REST sync | |
| 1252 | + # and the classic-editor Canonical box both still write it, and | |
| 1253 | + # the GraphQL surface reads both keys as well. | |
| 1247 | 1254 | foreach (array('_metasync_canonical_url', 'meta_canonical') as $canonical_key) { |
| 1248 | 1255 | $canonical_override = Metasync_Canonical_Sanitizer::sanitize( |
| 1249 | 1256 | get_post_meta($post->ID, $canonical_key, true) |
| 1250 | 1257 | ); |
| @@ -1769,9 +1776,8 @@ | ||
| 1769 | 1776 | $preview_html = $this->generate_preview_html($title, $description, $image, $url, $twitter_title, $twitter_description, $twitter_image); |
| 1770 | 1777 | |
| 1771 | 1778 | if (empty($preview_html)) { |
| 1772 | 1779 | wp_send_json_error(['message' => 'Failed to generate preview HTML']); |
| 1773 | - return; | |
| 1774 | 1780 | } |
| 1775 | 1781 | |
| 1776 | 1782 | wp_send_json_success(['preview' => $preview_html]); |
| 1777 | 1783 | |