File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -828,12 +828,18 @@ function serialize_block( $block, $callback = null ) {
828828 * parsed blocks.
829829 *
830830 * @since 5.3.1
831+ * @since 6.4.0 The `$callback` parameter was added.
831832 *
832833 * @param array[] $blocks An array of representative arrays of parsed block objects. See serialize_block().
834+ * @param string $callback Optional. Callback to run on the blocks before serialization.
833835 * @return string String of rendered HTML.
834836 */
835- function serialize_blocks ( $ blocks ) {
836- return implode ( '' , array_map ( 'serialize_block ' , $ blocks ) );
837+ function serialize_blocks ( $ blocks , $ callback = null ) {
838+ $ result = '' ;
839+ foreach ( $ blocks as $ block ) {
840+ $ result .= serialize_block ( $ block , $ callback );
841+ };
842+ return $ result ;
837843}
838844
839845/**
You can’t perform that action at this time.
0 commit comments