Skip to content

Commit

Permalink
Merge pull request #6574 from ampproject/fix/2.1-build-error-for-tiktok
Browse files Browse the repository at this point in the history
[2.1] Use string literal for amp-tiktok instead of constant until amp-toolbox updated
  • Loading branch information
westonruter authored Aug 27, 2021
1 parent d4d2a7b commit 7d36a92
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions includes/embeds/class-amp-tiktok-embed-handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use AmpProject\Attribute;
use AmpProject\Dom\Document;
use AmpProject\Dom\Element;
use AmpProject\Extension;
use AmpProject\Layout;
use AmpProject\Tag;

Expand Down Expand Up @@ -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 ) {
Expand All @@ -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,
Expand Down

0 comments on commit 7d36a92

Please sign in to comment.