]*wp-block-group__inner-container(\s|")[^>]*>)((.|\S|\s)*)/';
if (
( isset( $block['blockName'] ) && 'core/group' !== $block['blockName'] ) ||
1 === preg_match( $group_with_inner_container_regex, $block_content )
) {
return $block_content;
}
$replace_regex = '/(^\s*
]*wp-block-group[^>]*>)(.*)(<\/div>\s*$)/ms';
$updated_content = preg_replace_callback(
$replace_regex,
array( $this, 'group_block_replace_regex' ),
$block_content
);
return $updated_content;
}
/**
* Update the block content with inner div.
*
* @since 3.7.1
* @access public
*
* @param mixed $matches block content.
*
* @return string New block content.
*/
public function group_block_replace_regex( $matches ) {
return $matches[1] . '
' . $matches[2] . '
' . $matches[3];
}
}
/**
* Kicking this off by object
*/
new Astra_Gutenberg();