Skip to content

Commit

Permalink
Also work for more innerBlock's #2
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielFloeter committed Oct 24, 2024
1 parent ad9ef60 commit 770a050
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hyperlink-group-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function add_button_size_class( $block_content = '', $block = [] ) {

$stripAnchors = function( $block ) use ( &$stripAnchors, &$html, &$block_content ) {
foreach( $block as $b){
if( str_contains( $b['innerHTML'], '<a' ) ) {
if( str_contains( $b['innerHTML'], '<a' ) ) {
$replace = $b['innerHTML'];
$b['innerHTML'] = str_replace(
'<a',
Expand All @@ -91,12 +91,12 @@ function add_button_size_class( $block_content = '', $block = [] ) {
$block_content
);
$block_content = str_replace(
$replace,
trim($replace),
$b['innerHTML'],
$block_content
);
}
if( ! empty( $b['innerBlocks'] ) ) {
if( ! empty( $b['innerBlocks'] ) ) {
$stripAnchors( $b['innerBlocks'] );
}
}
Expand Down

0 comments on commit 770a050

Please sign in to comment.