acf_replace_inner_blocks_in_block_content()
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() 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;
}