From 7d36a92a83e231e575b4a1bbdc9abe5cca92ebf0 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 27 Aug 2021 09:47:55 -0700 Subject: [PATCH] Merge pull request #6574 from ampproject/fix/2.1-build-error-for-tiktok [2.1] Use string literal for amp-tiktok instead of constant until amp-toolbox updated --- includes/embeds/class-amp-tiktok-embed-handler.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/embeds/class-amp-tiktok-embed-handler.php b/includes/embeds/class-amp-tiktok-embed-handler.php index f399483ab51..60049f02622 100644 --- a/includes/embeds/class-amp-tiktok-embed-handler.php +++ b/includes/embeds/class-amp-tiktok-embed-handler.php @@ -8,7 +8,6 @@ use AmpProject\Attribute; use AmpProject\Dom\Document; use AmpProject\Dom\Element; -use AmpProject\Extension; use AmpProject\Layout; use AmpProject\Tag; @@ -40,7 +39,7 @@ public function unregister_embed() { */ public function sanitize_raw_embeds( Document $dom ) { $nodes = $dom->xpath->query( - sprintf( '//blockquote[ @cite and @data-video-id and contains( @class, "tiktok-embed" ) and not( parent::%s ) ]', Extension::TIKTOK ) + sprintf( '//blockquote[ @cite and @data-video-id and contains( @class, "tiktok-embed" ) and not( parent::%s ) ]', 'amp-tiktok' ) ); foreach ( $nodes as $node ) { @@ -66,7 +65,7 @@ protected function make_embed_amp_compatible( Element $blockquote ) { $amp_tiktok = AMP_DOM_Utils::create_node( Document::fromNode( $dom ), - Extension::TIKTOK, + 'amp-tiktok', [ Attribute::LAYOUT => Layout::RESPONSIVE, Attribute::HEIGHT => 575,