| @@ -162,8 +162,18 @@ | ||
| 162 | 162 | if (array_key_exists('outputSchema', $attrs) && false === $attrs['outputSchema']) { |
| 163 | 163 | return $block_content; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | + // The Schema master switch and the matrix's per-content-type switch. | |
| 167 | + // This producer writes its own <script> into the block's markup rather | |
| 168 | + // than registering with Schema_Graph, so gating the graph does not | |
| 169 | + // reach it — a block kept publishing FAQPage/HowTo/ItemList with Schema | |
| 170 | + // switched off (#688). | |
| 171 | + if (class_exists('ThinkRank\\Frontend\\Schema_Graph') | |
| 172 | + && !\ThinkRank\Frontend\Schema_Graph::output_allowed()) { | |
| 173 | + return $block_content; | |
| 174 | + } | |
| 175 | + | |
| 166 | 176 | if (self::FAQ_BLOCK === $name) { |
| 167 | 177 | // Saved markup carries a bare <img src>, because save.js output is |
| 168 | 178 | // what the block validates against and cannot be changed without |
| 169 | 179 | // invalidating every FAQ block already in the wild. Upgrading it |
| @@ -210,9 +220,9 @@ | ||
| 210 | 220 | if (false === $json) { |
| 211 | 221 | return $block_content; |
| 212 | 222 | } |
| 213 | 223 | |
| 214 | - return $block_content . "\n" . '<script type="application/ld+json">' . $json . '</script>'; | |
| 224 | + return $block_content . "\n" . '<script type="application/ld+json" data-thinkrank="block">' . $json . '</script>'; | |
| 215 | 225 | } |
| 216 | 226 | |
| 217 | 227 | /** |
| 218 | 228 | * Resolve a FAQ item's image to what should actually be rendered. |