diff --git a/classes/Tools/Storage/StorageContentHooks.php b/classes/Tools/Storage/StorageContentHooks.php index 0ae729f7..e7819e82 100644 --- a/classes/Tools/Storage/StorageContentHooks.php +++ b/classes/Tools/Storage/StorageContentHooks.php @@ -191,11 +191,11 @@ private function processCoverBlock($id, $block_content) { continue; } - if (strpos($class[1], 'wp-block-cover') === false) { + if ( !preg_match("/wp-block-cover(\s|$)/ui", $class[1]) ) { continue; } - $block_content = str_replace($class[1], "{$class[1]} mcloud-attachment-{$id}", $block_content); + $block_content = preg_replace("/([\s'\"])({$class[1]})([\s'\"])/ui", "$1$2 mcloud-attachment-{$id} $3", $block_content); } } @@ -1223,4 +1223,4 @@ public function calculateSrcSet($sources, $size_array, $image_src, $image_meta, return $newSources; } //endregion -} \ No newline at end of file +}