Replace paragraph class when other is defined

[MAILPOET-3474]
This commit is contained in:
Jan Lysý
2021-09-30 12:34:00 +02:00
committed by Veljko V
parent 97e1263451
commit e2c1534ea9

View File

@@ -68,7 +68,7 @@ class PostContentManager {
$content = strip_tags($content, implode('', $tagsNotBeingStripped));
if ($withPostClass) {
$content = str_replace('<p', '<p class="' . self::WP_POST_CLASS . '"', WPFunctions::get()->wpautop($content));
$content = preg_replace('/<p( class=\".+\")?/', '<p class="' . self::WP_POST_CLASS . '"', WPFunctions::get()->wpautop($content));
} else {
$content = WPFunctions::get()->wpautop($content);
}