You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: includes/class-feed-shortcode.php
+65-1Lines changed: 65 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,50 @@ public function register() {
18
18
add_shortcode('opio_feed', array($this, 'init'));
19
19
}
20
20
21
+
/**
22
+
* Extract JSON-LD schema from HTML head section and remove it from head
23
+
*/
24
+
privatefunctionextract_jsonld_schema(&$html) {
25
+
// Extract the JSON-LD schema script from head
26
+
if (preg_match('/<head[^>]*>.*?<script[^>]*id=["\']jsonldSchema["\'][^>]*type=["\']application\/ld\+json["\'][^>]*>(.*?)<\/script>.*?<\/head>/is', $html, $matches)) {
0 commit comments