I'm working on a custom theme, and I would like to display the facebook embed from Gutenberg in Wordpress. I've done parse_blocks
and then printing the block displays just the facebook url.
// page-home.php
$post = get_post();
if (has_blocks($post->post_content)) {
$blocks = parse_blocks($post->post_content);
foreach($blocks as $block){
if ($block[blockName] === 'core/embed/facebook') {
// starting to get stuck here...
}
}
}
How do I display the facebook embed?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745094325a4610882.html
评论列表(0条)