Returns the content of a block, including comment delimiters, serializing all attributes from the given parsed block.
Description
This should be used when preparing a block to be saved to post content.Prefer render_block when preparing a block for display. Unlike render_block, this does not evaluate a block's render_callback, and will instead preserve the markup as parsed.
Parameters
$blockarray
An associative array of a single parsed block object. See WP_Block_Parser_Block.
$blockNamestring
Name of block.
$attrsarray
Attributes from block comment delimiters.
$innerBlocksarray[]
List of inner blocks. An array of arrays that have the same structure as this one.
$innerHTMLstring
HTML from inside block comment delimiters.
$innerContentarray
List of string fragments and null markers where inner blocks were found.
Return
string
String of rendered HTML.
Uses · 2
serialize_block()Returns the content of a block, including comment delimiters, serializing all attributes from the given parsed block.
Signature, return type and hooks compared across 5 parsed releases.
About this page
Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/blocks.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.