-
-
Save billerickson/773d92e2ba2a50badaed5d543d31bc21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function be_get_block( $blockName = '' ) { | |
global $post; | |
$blocks = parse_blocks( $post->post_content ); | |
foreach( $blocks as $block ) { | |
if( $blockName === $block['blockName'] ) | |
return render_block( $block ); | |
} | |
// Example Usage | |
echo be_get_block( 'core/quote' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment