| @@ -245,8 +245,17 @@ | ||
| 245 | 245 | * @param array $settings Module settings. |
| 246 | 246 | * @return void |
| 247 | 247 | */ |
| 248 | 248 | private function maybe_render_schema(array $settings): void { |
| 249 | + | |
| 250 | + // The Schema master switch and the matrix's per-content-type switch. | |
| 251 | + // This widget echoes its own <script> rather than registering with | |
| 252 | + // Schema_Graph, so gating the graph never reached it and it kept | |
| 253 | + // publishing with Schema switched off (#688). | |
| 254 | + if (class_exists('ThinkRank\\Frontend\\Schema_Graph') | |
| 255 | + && !\ThinkRank\Frontend\Schema_Graph::output_allowed()) { | |
| 256 | + return; | |
| 257 | + } | |
| 249 | 258 | if (!self::schema_enabled($settings)) { |
| 250 | 259 | return; |
| 251 | 260 | } |
| 252 | 261 | |
| @@ -276,9 +285,9 @@ | ||
| 276 | 285 | 'mainEntity' => $entities, |
| 277 | 286 | ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); |
| 278 | 287 | |
| 279 | 288 | if (false !== $json) { |
| 280 | - echo '<script type="application/ld+json">' . $json . '</script>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 289 | + echo '<script type="application/ld+json" data-thinkrank="faq">' . $json . '</script>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 281 | 290 | } |
| 282 | 291 | } |
| 283 | 292 | |
| 284 | 293 | /** |