Add Blank category to templates

[MAILPOET-2345]
This commit is contained in:
Pavel Dohnal
2019-09-18 11:01:46 +02:00
committed by Jack Kitterhing
parent 47ebcf3b84
commit 1dd0c4ec70
8 changed files with 7 additions and 23 deletions

View File

@ -14,7 +14,6 @@ use MailPoet\Cron\Workers\StatsNotifications\Worker;
use MailPoet\Cron\Workers\UnsubscribeTokens;
use MailPoet\Cron\Workers\SubscriberLinkTokens;
use MailPoet\Mailer\MailerLog;
use MailPoet\Models\NewsletterTemplate;
use MailPoet\Models\Form;
use MailPoet\Models\ScheduledTask;
use MailPoet\Models\Segment;
@ -163,7 +162,6 @@ class Populator {
$this->createDefaultUsersFlags();
$this->createMailPoetPage();
$this->createSourceForSubscribers();
$this->updateNewsletterCategories();
$this->updateMetaFields();
$this->scheduleInitialInactiveSubscribersCheck();
$this->scheduleAuthorizedSendingEmailsCheck();
@ -561,20 +559,6 @@ class Populator {
);
}
private function updateNewsletterCategories() {
global $wpdb;
// perform once for versions below or equal to 3.14.0
if (version_compare($this->settings->get('db_version', '3.14.1'), '3.14.0', '>')) {
return false;
}
$query = "UPDATE `%s` SET categories = REPLACE(REPLACE(categories, ',\"blank\"', ''), ',\"sample\"', ',\"all\"')";
$wpdb->query(sprintf(
$query,
NewsletterTemplate::$_table
));
return true;
}
private function updateMetaFields() {
global $wpdb;
// perform once for versions below or equal to 3.26.0

View File

@ -21,7 +21,7 @@ class NewsletterBlank121Column {
function get() {
return [
'name' => WPFunctions::get()->__("Newsletter: Blank 1:2:1 Column", 'mailpoet'),
'categories' => json_encode(['standard']),
'categories' => json_encode(['standard', 'blank']),
'readonly' => 1,
'thumbnail' => $this->getThumbnail(),
'body' => json_encode($this->getBody()),

View File

@ -21,7 +21,7 @@ class NewsletterBlank12Column {
function get() {
return [
'name' => WPFunctions::get()->__("Newsletter: Blank 1:2 Column", 'mailpoet'),
'categories' => json_encode(['standard']),
'categories' => json_encode(['standard', 'blank']),
'readonly' => 1,
'thumbnail' => $this->getThumbnail(),
'body' => json_encode($this->getBody()),

View File

@ -21,7 +21,7 @@ class NewsletterBlank13Column {
function get() {
return [
'name' => WPFunctions::get()->__("Newsletter: Blank 1:3 Column", 'mailpoet'),
'categories' => json_encode(['standard']),
'categories' => json_encode(['standard', 'blank']),
'readonly' => 1,
'thumbnail' => $this->getThumbnail(),
'body' => json_encode($this->getBody()),

View File

@ -21,7 +21,7 @@ class NewsletterBlank1Column {
function get() {
return [
'name' => WPFunctions::get()->__("Newsletter: Blank 1 Column", 'mailpoet'),
'categories' => json_encode(['standard']),
'categories' => json_encode(['standard', 'blank']),
'readonly' => 1,
'thumbnail' => $this->getThumbnail(),
'body' => json_encode($this->getBody()),

View File

@ -21,7 +21,7 @@ class PostNotificationsBlank1Column {
function get() {
return [
'name' => WPFunctions::get()->__("Post Notifications: Blank 1 Column", 'mailpoet'),
'categories' => json_encode(['notification']),
'categories' => json_encode(['notification', 'blank']),
'readonly' => 1,
'thumbnail' => $this->getThumbnail(),
'body' => json_encode($this->getBody()),

View File

@ -21,7 +21,7 @@ class WelcomeBlank12Column {
function get() {
return [
'name' => WPFunctions::get()->__("Welcome Email: Blank 1:2 Column", 'mailpoet'),
'categories' => json_encode(['welcome']),
'categories' => json_encode(['welcome', 'blank']),
'readonly' => 1,
'thumbnail' => $this->getThumbnail(),
'body' => json_encode($this->getBody()),

View File

@ -21,7 +21,7 @@ class WelcomeBlank1Column {
function get() {
return [
'name' => WPFunctions::get()->__("Welcome Email: Blank 1 Column", 'mailpoet'),
'categories' => json_encode(['welcome']),
'categories' => json_encode(['welcome', 'blank']),
'readonly' => 1,
'thumbnail' => $this->getThumbnail(),
'body' => json_encode($this->getBody()),