| @@ -281,8 +281,17 @@ | ||
| 281 | 281 | * @param array $items Usable FAQ rows. |
| 282 | 282 | * @return void |
| 283 | 283 | */ |
| 284 | 284 | private function maybe_render_schema(array $settings, array $items): void { |
| 285 | + | |
| 286 | + // The Schema master switch and the matrix's per-content-type switch. | |
| 287 | + // This widget echoes its own <script> rather than registering with | |
| 288 | + // Schema_Graph, so gating the graph never reached it and it kept | |
| 289 | + // publishing with Schema switched off (#688). | |
| 290 | + if (class_exists('ThinkRank\\Frontend\\Schema_Graph') | |
| 291 | + && !\ThinkRank\Frontend\Schema_Graph::output_allowed()) { | |
| 292 | + return; | |
| 293 | + } | |
| 285 | 294 | unset($items); |
| 286 | 295 | |
| 287 | 296 | if (!self::schema_enabled($settings)) { |
| 288 | 297 | return; |
| @@ -314,9 +323,9 @@ | ||
| 314 | 323 | 'mainEntity' => $entities, |
| 315 | 324 | ], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS | JSON_HEX_QUOT); |
| 316 | 325 | |
| 317 | 326 | if (false !== $json) { |
| 318 | - echo '<script type="application/ld+json">' . $json . '</script>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 327 | + echo '<script type="application/ld+json" data-thinkrank="faq">' . $json . '</script>'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 319 | 328 | } |
| 320 | 329 | } |
| 321 | 330 | |
| 322 | 331 | /** |