Remove top padding for ALC & Post block titles
[MAILPOET-1701]
This commit is contained in:
@ -237,7 +237,6 @@ class PostTransformer {
|
|||||||
|
|
||||||
private function getTitle($post) {
|
private function getTitle($post) {
|
||||||
$title = $this->sanitizeTitle($post->post_title);
|
$title = $this->sanitizeTitle($post->post_title);
|
||||||
$top_padding = '20px';
|
|
||||||
|
|
||||||
if (filter_var($this->args['titleIsLink'], FILTER_VALIDATE_BOOLEAN)) {
|
if (filter_var($this->args['titleIsLink'], FILTER_VALIDATE_BOOLEAN)) {
|
||||||
$title = '<a href="' . $this->wp->getPermalink($post->ID) . '">' . $title . '</a>';
|
$title = '<a href="' . $this->wp->getPermalink($post->ID) . '">' . $title . '</a>';
|
||||||
@ -247,7 +246,6 @@ class PostTransformer {
|
|||||||
$tag = $this->args['titleFormat'];
|
$tag = $this->args['titleFormat'];
|
||||||
} elseif ($this->args['titleFormat'] === 'ul') {
|
} elseif ($this->args['titleFormat'] === 'ul') {
|
||||||
$tag = 'li';
|
$tag = 'li';
|
||||||
$top_padding = '0';
|
|
||||||
} else {
|
} else {
|
||||||
$tag = 'h1';
|
$tag = 'h1';
|
||||||
}
|
}
|
||||||
@ -258,11 +256,6 @@ class PostTransformer {
|
|||||||
return array(
|
return array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'text' => $title,
|
'text' => $title,
|
||||||
'styles' => [
|
|
||||||
'block' => [
|
|
||||||
'paddingTop' => $top_padding,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,6 @@ use MailPoet\Util\pQuery\pQuery;
|
|||||||
class Text {
|
class Text {
|
||||||
static function render($element) {
|
static function render($element) {
|
||||||
$html = $element['text'];
|
$html = $element['text'];
|
||||||
$padding_top = isset($element['styles']['block']['paddingTop']) ? 'padding-top:' . $element['styles']['block']['paddingTop'] : '';
|
|
||||||
// replace with spaces
|
// replace with spaces
|
||||||
$html = str_replace(' ', ' ', $html);
|
$html = str_replace(' ', ' ', $html);
|
||||||
$html = str_replace('\xc2\xa0', ' ', $html);
|
$html = str_replace('\xc2\xa0', ' ', $html);
|
||||||
@ -19,7 +18,7 @@ class Text {
|
|||||||
$html = self::removeLastLineBreak($html);
|
$html = self::removeLastLineBreak($html);
|
||||||
$template = '
|
$template = '
|
||||||
<tr>
|
<tr>
|
||||||
<td class="mailpoet_text mailpoet_padded_vertical mailpoet_padded_side" valign="top" style="word-break:break-word;word-wrap:break-word;' . $padding_top .'">
|
<td class="mailpoet_text mailpoet_padded_vertical mailpoet_padded_side" valign="top" style="word-break:break-word;word-wrap:break-word;">
|
||||||
' . $html . '
|
' . $html . '
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
<div class="mailpoet_tools"></div>
|
<div class="mailpoet_tools"></div>
|
||||||
<div
|
<div class="mailpoet_content mailpoet_text_content">
|
||||||
class="mailpoet_content mailpoet_text_content"
|
|
||||||
{{#if model.styles.block.paddingTop }}style="padding-top:{{model.styles.block.paddingTop}};"{{/if}}
|
|
||||||
>
|
|
||||||
{{{ model.text }}}
|
{{{ model.text }}}
|
||||||
</div>
|
</div>
|
||||||
<div class="mailpoet_block_highlight"></div>
|
<div class="mailpoet_block_highlight"></div>
|
||||||
|
Reference in New Issue
Block a user