-
-
Save billerickson/f23881b54d7ae040e4044823da37949a 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 | |
/** | |
* Display blockquote from post | |
* @see https://www.billerickson.net/access-gutenberg-block-data/ | |
*/ | |
function be_display_post_blockquote() { | |
global $post; | |
$blocks = parse_blocks( $post->post_content ); | |
foreach( $blocks as $block ) { | |
if( 'core/quote' === $block['blockName'] ) { | |
echo render_block( $block ); | |
break; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment