Video not displaying if it’s dynamically inserted using do_blocks()
-
The video is not displaying if I try to insert a video before my content as the code below.
function test( $content ) {
$test = do_blocks( '
<!-- wp:presto-player/reusable-display {"id":49} -->
<div class="wp-block-presto-player-reusable-display"></div>
<!-- /wp:presto-player/reusable-display -->
' );
return $test . $content;
}
add_filter( 'the_content', 'test' );After checking your code it seems that you are checking the presence of the block in the
hasPlayer()function of theScripts.phpclass.You better enqueue scripts using block.json.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Video not displaying if it’s dynamically inserted using do_blocks()’ is closed to new replies.