Sometimes you want to append to `post_content` in PHP.
You can use the get_comment_delimited_block_content function to serialize Gutenberg syntax in a way that correctly shows as blocks in the editor:
$post_content .= get_comment_delimited_block_content(
'block_name',
[
'attribute' => $value,
],
'<p>' . $content . '</p>'
);
The post Writing serialized Gutenberg blocks in PHP appeared first on Artur Piszek.