acf_replace_inner_blocks_in_block_content()ACF 6.8

Replaces InnerBlocks strings in a block with the inner block content.

No Hooks.

Returns

String.

Usage

acf_replace_inner_blocks_in_block_content( $content, $html );
$content(string) (required)
The block content.
$html(string) (required)
The block html.

Changelog

Since 6.8 Introduced.

acf_replace_inner_blocks_in_block_content() code ACF 6.8.8

function acf_replace_inner_blocks_in_block_content( $content, $html ) {

	$html = preg_replace_callback(
		'/<InnerBlocks([\S\s]*?)\/>/',
		function ( $matches ) use ( $content ) {
			return $content;
		},
		$html
	);

	return $html;
}