replace mailpoet_title 'hack' by checking the post type
This commit is contained in:
@@ -33,7 +33,7 @@ class Pages {
|
|||||||
'post_type' => 'mailpoet_page',
|
'post_type' => 'mailpoet_page',
|
||||||
'post_author' => 1,
|
'post_author' => 1,
|
||||||
'post_content' => '[mailpoet_page]',
|
'post_content' => '[mailpoet_page]',
|
||||||
'post_title' => '[mailpoet_title]',
|
'post_title' => __('MailPoet Page'),
|
||||||
'post_name' => 'subscriptions'
|
'post_name' => 'subscriptions'
|
||||||
));
|
));
|
||||||
flush_rewrite_rules();
|
flush_rewrite_rules();
|
||||||
|
@@ -64,14 +64,10 @@ class Pages {
|
|||||||
return $meta;
|
return $meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPageTitle($page_title = '[mailpoet_title]') {
|
function setPageTitle($page_title = '') {
|
||||||
if(
|
global $post;
|
||||||
(strpos($page_title, '[mailpoet_title]') === false)
|
|
||||||
&&
|
if($post->post_type === 'mailpoet_page') {
|
||||||
(strlen(trim($page_title)) > 0)
|
|
||||||
) {
|
|
||||||
return $page_title;
|
|
||||||
} else {
|
|
||||||
$subscriber = $this->getSubscriber();
|
$subscriber = $this->getSubscriber();
|
||||||
switch($this->getAction()) {
|
switch($this->getAction()) {
|
||||||
case 'confirm':
|
case 'confirm':
|
||||||
@@ -93,7 +89,7 @@ class Pages {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return str_replace('[mailpoet_title]', $title, $page_title);
|
return $page_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPageContent($page_content = '[mailpoet_page]') {
|
function setPageContent($page_content = '[mailpoet_page]') {
|
||||||
|
Reference in New Issue
Block a user