From 03ad1b1370776d5b12511e501155ca693c2b57a1 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Tue, 19 Jun 2018 23:55:35 -0700 Subject: [PATCH] Construct schema.org meta script by appending text node --- includes/class-amp-theme-support.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/class-amp-theme-support.php b/includes/class-amp-theme-support.php index a7c78204a7f..4795c202102 100644 --- a/includes/class-amp-theme-support.php +++ b/includes/class-amp-theme-support.php @@ -981,8 +981,9 @@ public static function ensure_required_markup( DOMDocument $dom ) { } } if ( ! $has_schema_org_metadata ) { - $script = $dom->createElement( 'script', wp_json_encode( amp_get_schemaorg_metadata() ) ); + $script = $dom->createElement( 'script' ); $script->setAttribute( 'type', 'application/ld+json' ); + $script->appendChild( $dom->createTextNode( wp_json_encode( amp_get_schemaorg_metadata() ) ) ); $head->appendChild( $script ); } // Ensure rel=canonical link.