| @@ -187,9 +187,15 @@ | ||
| 187 | 187 | $output .= '</div>'; |
| 188 | 188 | |
| 189 | 189 | echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 190 | 190 | |
| 191 | - $this->render_builder_script($uid, $max_level, !empty($settings['outputSchema'])); | |
| 191 | + // Built client-side, so it bypasses Schema_Graph and the block filter | |
| 192 | + // and kept publishing an ItemList with Schema switched off (#688). | |
| 193 | + $schema = !empty($settings['outputSchema']) | |
| 194 | + && (!class_exists('ThinkRank\\Frontend\\Schema_Graph') | |
| 195 | + || \ThinkRank\Frontend\Schema_Graph::output_allowed()); | |
| 196 | + | |
| 197 | + $this->render_builder_script($uid, $max_level, $schema); | |
| 192 | 198 | } |
| 193 | 199 | |
| 194 | 200 | /** |
| 195 | 201 | * The dependency-free script that fills the list in. |
| @@ -285,8 +291,9 @@ | ||
| 285 | 291 | }; |
| 286 | 292 | } ); |
| 287 | 293 | var tag = document.createElement( 'script' ); |
| 288 | 294 | tag.type = 'application/ld+json'; |
| 295 | + tag.setAttribute( 'data-thinkrank', 'toc' ); | |
| 289 | 296 | tag.textContent = JSON.stringify( { |
| 290 | 297 | '@context': 'https://schema.org', |
| 291 | 298 | '@graph': graph |
| 292 | 299 | } ); |