diff --git a/inc/filters.php b/inc/filters.php index f3acf35..a4b0002 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -31,7 +31,14 @@ function render_block( $block_content, $block ) { $cookie_text .= '

'; $block_content = str_replace( 'src=', 'data-cookieconsent="marketing" data-cookieblock-src=', $block_content ); - $block_content = str_replace( '', $cookie_text . '', $block_content ); + + // If there is
, add the cookie text before it. + $figcaption_check = strpos( $block_content, '', $cookie_text . '', $block_content ); + } } return $block_content;