Add space between if and ‘(‘
[MAILPOET-1791]
This commit is contained in:
@@ -33,9 +33,9 @@ class Pages {
|
||||
$this->action = $action;
|
||||
$this->data = $data;
|
||||
$this->subscriber = $this->getSubscriber();
|
||||
if($init_page_filters) $this->initPageFilters();
|
||||
if($init_shortcodes) $this->initShortcodes();
|
||||
if($new_subscriber_notification_sender) {
|
||||
if ($init_page_filters) $this->initPageFilters();
|
||||
if ($init_shortcodes) $this->initShortcodes();
|
||||
if ($new_subscriber_notification_sender) {
|
||||
$this->new_subscriber_notification_sender = $new_subscriber_notification_sender;
|
||||
} else {
|
||||
$this->new_subscriber_notification_sender = new NewSubscriberNotificationMailer();
|
||||
@@ -64,7 +64,7 @@ class Pages {
|
||||
$email = (isset($this->data['email'])) ? $this->data['email'] : null;
|
||||
$wp_user = wp_get_current_user();
|
||||
|
||||
if(!$email && $wp_user->exists()) {
|
||||
if (!$email && $wp_user->exists()) {
|
||||
return Subscriber::where('wp_user_id', $wp_user->ID)->findOne();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ class Pages {
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
if($this->subscriber === false || $this->subscriber->status === Subscriber::STATUS_SUBSCRIBED) {
|
||||
if ($this->subscriber === false || $this->subscriber->status === Subscriber::STATUS_SUBSCRIBED) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -86,10 +86,10 @@ class Pages {
|
||||
$this->subscriber->unconfirmed_data = null;
|
||||
$this->subscriber->save();
|
||||
|
||||
if($this->subscriber->getErrors() === false) {
|
||||
if ($this->subscriber->getErrors() === false) {
|
||||
// send welcome notification
|
||||
$subscriber_segments = $this->subscriber->segments()->findMany();
|
||||
if($subscriber_segments) {
|
||||
if ($subscriber_segments) {
|
||||
Scheduler::scheduleSubscriberWelcomeNotification(
|
||||
$this->subscriber->id,
|
||||
array_map(function ($segment) {
|
||||
@@ -101,15 +101,15 @@ class Pages {
|
||||
$this->new_subscriber_notification_sender->send($this->subscriber, $subscriber_segments);
|
||||
|
||||
// update subscriber from stored data after confirmation
|
||||
if(!empty($subscriber_data)) {
|
||||
if (!empty($subscriber_data)) {
|
||||
Subscriber::createOrUpdate($subscriber_data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function unsubscribe() {
|
||||
if($this->subscriber !== false) {
|
||||
if($this->subscriber->status !== Subscriber::STATUS_UNSUBSCRIBED) {
|
||||
if ($this->subscriber !== false) {
|
||||
if ($this->subscriber->status !== Subscriber::STATUS_UNSUBSCRIBED) {
|
||||
$this->subscriber->status = Subscriber::STATUS_UNSUBSCRIBED;
|
||||
$this->subscriber->save();
|
||||
SubscriberSegment::unsubscribeFromSegments($this->subscriber);
|
||||
@@ -120,11 +120,11 @@ class Pages {
|
||||
function setPageTitle($page_title = '') {
|
||||
global $post;
|
||||
|
||||
if($this->isPreview() === false && $this->subscriber === false) {
|
||||
if ($this->isPreview() === false && $this->subscriber === false) {
|
||||
return __("Hmmm... we don't have a record of you.", 'mailpoet');
|
||||
}
|
||||
|
||||
if(
|
||||
if (
|
||||
($post->post_title !== __('MailPoet Page', 'mailpoet'))
|
||||
||
|
||||
($page_title !== single_post_title('', false))
|
||||
@@ -150,11 +150,11 @@ class Pages {
|
||||
global $post;
|
||||
|
||||
// if we're not in preview mode and the subscriber does not exist
|
||||
if($this->isPreview() === false && $this->subscriber === false) {
|
||||
if ($this->isPreview() === false && $this->subscriber === false) {
|
||||
return __("Your email address doesn't appear in our lists anymore. Sign up again or contact us if this appears to be a mistake.", 'mailpoet');
|
||||
}
|
||||
|
||||
if(strpos($page_content, '[mailpoet_page]') !== false) {
|
||||
if (strpos($page_content, '[mailpoet_page]') !== false) {
|
||||
$content = '';
|
||||
|
||||
switch ($this->action) {
|
||||
@@ -176,7 +176,7 @@ class Pages {
|
||||
|
||||
function setWindowTitle($title, $separator, $separator_location = 'right') {
|
||||
$title_parts = explode(" $separator ", $title);
|
||||
if($separator_location === 'right') {
|
||||
if ($separator_location === 'right') {
|
||||
// first part
|
||||
$title_parts[0] = $this->setPageTitle($title_parts[0]);
|
||||
} else {
|
||||
@@ -193,7 +193,7 @@ class Pages {
|
||||
}
|
||||
|
||||
private function getConfirmTitle() {
|
||||
if($this->isPreview()) {
|
||||
if ($this->isPreview()) {
|
||||
$title = sprintf(
|
||||
__("You have subscribed to: %s", 'mailpoet'),
|
||||
'demo 1, demo 2'
|
||||
@@ -203,7 +203,7 @@ class Pages {
|
||||
return $segment->name;
|
||||
}, $this->subscriber->segments()->findMany());
|
||||
|
||||
if(empty($segment_names)) {
|
||||
if (empty($segment_names)) {
|
||||
$title = __("You are now subscribed!", 'mailpoet');
|
||||
} else {
|
||||
$title = sprintf(
|
||||
@@ -216,25 +216,25 @@ class Pages {
|
||||
}
|
||||
|
||||
private function getManageTitle() {
|
||||
if($this->isPreview() || $this->subscriber !== false) {
|
||||
if ($this->isPreview() || $this->subscriber !== false) {
|
||||
return __("Manage your subscription", 'mailpoet');
|
||||
}
|
||||
}
|
||||
|
||||
private function getUnsubscribeTitle() {
|
||||
if($this->isPreview() || $this->subscriber !== false) {
|
||||
if ($this->isPreview() || $this->subscriber !== false) {
|
||||
return __("You are now unsubscribed.", 'mailpoet');
|
||||
}
|
||||
}
|
||||
|
||||
private function getConfirmContent() {
|
||||
if($this->isPreview() || $this->subscriber !== false) {
|
||||
if ($this->isPreview() || $this->subscriber !== false) {
|
||||
return __("Yup, we've added you to our email list. You'll hear from us shortly.", 'mailpoet');
|
||||
}
|
||||
}
|
||||
|
||||
public function getManageContent() {
|
||||
if($this->isPreview()) {
|
||||
if ($this->isPreview()) {
|
||||
$subscriber = Subscriber::create();
|
||||
$subscriber->hydrate(array(
|
||||
'email' => self::DEMO_EMAIL,
|
||||
@@ -254,7 +254,7 @@ class Pages {
|
||||
$custom_field = $custom_field->asArray();
|
||||
$custom_field['params']['value'] = $subscriber->{$custom_field['id']};
|
||||
|
||||
if($custom_field['type'] === 'date') {
|
||||
if ($custom_field['type'] === 'date') {
|
||||
$date_formats = FormBlockDate::getDateFormats();
|
||||
$custom_field['params']['date_format'] = array_shift(
|
||||
$date_formats[$custom_field['params']['date_type']]
|
||||
@@ -265,7 +265,7 @@ class Pages {
|
||||
}, CustomField::findMany());
|
||||
|
||||
$segment_ids = $this->settings->get('subscription.segments', []);
|
||||
if(!empty($segment_ids)) {
|
||||
if (!empty($segment_ids)) {
|
||||
$segments = Segment::getPublic()
|
||||
->whereIn('id', $segment_ids)
|
||||
->findMany();
|
||||
@@ -274,9 +274,9 @@ class Pages {
|
||||
->findMany();
|
||||
}
|
||||
$subscribed_segment_ids = array();
|
||||
if(!empty($this->subscriber->subscriptions)) {
|
||||
if (!empty($this->subscriber->subscriptions)) {
|
||||
foreach ($this->subscriber->subscriptions as $subscription) {
|
||||
if($subscription['status'] === Subscriber::STATUS_SUBSCRIBED) {
|
||||
if ($subscription['status'] === Subscriber::STATUS_SUBSCRIBED) {
|
||||
$subscribed_segment_ids[] = $subscription['segment_id'];
|
||||
}
|
||||
}
|
||||
@@ -391,10 +391,10 @@ class Pages {
|
||||
$form_html .= '<label>Email *<br /><strong>'.$subscriber->email.'</strong></label>';
|
||||
$form_html .= '<br /><span style="font-size:85%;">';
|
||||
// special case for WP users as they cannot edit their subscriber's email
|
||||
if($subscriber->isWPUser() || $subscriber->isWooCommerceUser()) {
|
||||
if ($subscriber->isWPUser() || $subscriber->isWooCommerceUser()) {
|
||||
// check if subscriber's associated WP user is the currently logged in WP user
|
||||
$wp_current_user = wp_get_current_user();
|
||||
if($wp_current_user->user_email === $subscriber->email) {
|
||||
if ($wp_current_user->user_email === $subscriber->email) {
|
||||
$form_html .= Helpers::replaceLinkTags(
|
||||
__('[link]Edit your profile[/link] to update your email.', 'mailpoet'),
|
||||
get_edit_profile_url(),
|
||||
@@ -421,7 +421,7 @@ class Pages {
|
||||
|
||||
private function getUnsubscribeContent() {
|
||||
$content = '';
|
||||
if($this->isPreview() || $this->subscriber !== false) {
|
||||
if ($this->isPreview() || $this->subscriber !== false) {
|
||||
$content .= '<p>'.__('Accidentally unsubscribed?', 'mailpoet').' <strong>';
|
||||
$content .= '[mailpoet_manage]';
|
||||
$content .= '</strong></p>';
|
||||
@@ -430,7 +430,7 @@ class Pages {
|
||||
}
|
||||
|
||||
function getManageLink($params) {
|
||||
if(!$this->subscriber) return __('Link to subscription management page is only available to mailing lists subscribers.', 'mailpoet');
|
||||
if (!$this->subscriber) return __('Link to subscription management page is only available to mailing lists subscribers.', 'mailpoet');
|
||||
|
||||
// get label or display default label
|
||||
$text = (
|
||||
|
Reference in New Issue
Block a user