- Conditionally keeps margin/padding for ALC posts inside editor

- Adds line breaks for ALC posts in the renderer
This commit is contained in:
Vlad
2016-12-29 13:29:08 -05:00
parent fb29800c7d
commit 698cdecbfe
4 changed files with 21 additions and 8 deletions

View File

@ -6,6 +6,7 @@ if(!defined('ABSPATH')) exit;
class PostContentManager {
const MAX_EXCERPT_LENGTH = 60;
const WP_POST_CLASS = 'mailpoet_wp_post';
function getContent($post, $displayType) {
if($displayType === 'titleOnly') {
@ -42,7 +43,7 @@ class PostContentManager {
'<h2>', '<h3>', '<a>', '<ul>', '<ol>', '<li>', '<br>'
);
$content = strip_tags($content, implode('', $tags_not_being_stripped));
$content = wpautop($content);
$content = str_replace('<p', '<p class="' . self::WP_POST_CLASS .'"', wpautop($content));
return $content;
}
@ -91,4 +92,4 @@ class PostContentManager {
return $content;
}
}
}