Get block content within reusable blocks
-
I’m using this function to append blocks to the_content:
function filter_the_content( $content ) { $header = $get_block = get_post( 1570 ); $header = $get_block->post_content; $footer = $get_block = get_post( 1586 ); $footer = $get_block->post_content; $content = $header . $content . $footer; return $content; } add_filter( 'the_content', 'filter_the_content' );
If the block I’m calling is a reusable block that has blocks inside, the $get_block->post_content returns as:
<!– wp:block {“ref”:1567} /–>
<!– wp:block {“ref”:1568} /–>How can I make it recursive so it prints the actual content of those blocks instead of the references?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Get block content within reusable blocks’ is closed to new replies.