removing top padding from excerpt text
This commit is contained in:
@@ -30,7 +30,7 @@ class PostContentManager {
|
||||
}
|
||||
}
|
||||
|
||||
function filterContent($content) {
|
||||
function filterContent($content, $with_post_class = true) {
|
||||
$content = self::convertEmbeddedContent($content);
|
||||
|
||||
// convert h4 h5 h6 to h3
|
||||
@@ -49,7 +49,9 @@ class PostContentManager {
|
||||
'<h2>', '<h3>', '<a>', '<ul>', '<ol>', '<li>', '<br>', '<blockquote>'
|
||||
);
|
||||
$content = strip_tags($content, implode('', $tags_not_being_stripped));
|
||||
if($with_post_class) {
|
||||
$content = str_replace('<p', '<p class="' . self::WP_POST_CLASS .'"', wpautop($content));
|
||||
}
|
||||
$content = trim($content);
|
||||
|
||||
return $content;
|
||||
|
@@ -37,7 +37,7 @@ class PostTransformer {
|
||||
}
|
||||
|
||||
private function getStructure($post) {
|
||||
$content = $this->getContent($post);
|
||||
$content = $this->getContent($post, true);
|
||||
$title = $this->getTitle($post);
|
||||
$featured_image = $this->getFeaturedImage($post);
|
||||
|
||||
@@ -60,7 +60,7 @@ class PostTransformer {
|
||||
}
|
||||
|
||||
private function getStructureWithLayout($post) {
|
||||
$content = $this->getContent($post);
|
||||
$content = $this->getContent($post, false);
|
||||
$title = $this->getTitle($post);
|
||||
$featured_image = $this->getFeaturedImage($post);
|
||||
|
||||
@@ -116,13 +116,13 @@ class PostTransformer {
|
||||
return $this->imagePosition;
|
||||
}
|
||||
|
||||
private function getContent($post) {
|
||||
private function getContent($post, $with_post_class) {
|
||||
$content_manager = new PostContentManager();
|
||||
$meta_manager = new MetaInformationManager();
|
||||
|
||||
$content = $content_manager->getContent($post, $this->args['displayType']);
|
||||
$content = $meta_manager->appendMetaInformation($content, $post, $this->args);
|
||||
$content = $content_manager->filterContent($content);
|
||||
$content = $content_manager->filterContent($content, $with_post_class);
|
||||
|
||||
$structure_transformer = new StructureTransformer();
|
||||
$content = $structure_transformer->transform($content, $this->args['imageFullWidth'] === true);
|
||||
|
Reference in New Issue
Block a user