Render preview page title correctly
[MAILPOET-2743]
This commit is contained in:
committed by
Veljko V
parent
d81c0d490b
commit
2711a00f3e
@@ -54,7 +54,10 @@ class PreviewPage {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function renderTitle() {
|
public function renderTitle($title = null, $id = null) {
|
||||||
|
if ($id !== $this->wp->getTheId()) {
|
||||||
|
return $title;
|
||||||
|
}
|
||||||
return __('Sample page to preview your form', 'mailpoet');
|
return __('Sample page to preview your form', 'mailpoet');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -35,7 +35,7 @@ class FormPreview {
|
|||||||
public function view(array $data) {
|
public function view(array $data) {
|
||||||
$this->data = $data;
|
$this->data = $data;
|
||||||
$this->wp->addFilter('the_content', [$this,'renderContent'], 10);
|
$this->wp->addFilter('the_content', [$this,'renderContent'], 10);
|
||||||
$this->wp->addFilter('the_title', [$this->formPreviewPage,'renderTitle'], 10);
|
$this->wp->addFilter('the_title', [$this->formPreviewPage,'renderTitle'], 10, 2);
|
||||||
$this->wp->addFilter('show_admin_bar', function () {
|
$this->wp->addFilter('show_admin_bar', function () {
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@@ -272,6 +272,13 @@ class Functions {
|
|||||||
return get_the_author_meta($field, $userId);
|
return get_the_author_meta($field, $userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return false|int
|
||||||
|
*/
|
||||||
|
public function getTheId() {
|
||||||
|
return get_the_ID();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int|\WP_User $userId
|
* @param int|\WP_User $userId
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user