fixed subscribe on registration not using the proper setting

This commit is contained in:
Jonathan Labreuille
2016-01-14 17:41:04 +01:00
parent e3719967f9
commit 8de186c0e6
2 changed files with 5 additions and 2 deletions

View File

@@ -190,6 +190,8 @@ class Menu {
}
function welcome() {
if((bool)(defined('DOING_AJAX') && DOING_AJAX)) return;
global $wp;
$current_url = home_url(add_query_arg($wp->query_string, $wp->request));
$redirect_url =

View File

@@ -44,7 +44,8 @@ class Registration {
$errors = null
) {
if(
isset($_POST['mailpoet']['subscribe_on_register'])
empty($errors->errors)
&& isset($_POST['mailpoet']['subscribe_on_register'])
&& (bool)$_POST['mailpoet']['subscribe_on_register'] === true
) {
static::subscribeNewUser(
@@ -56,7 +57,7 @@ class Registration {
private static function subscribeNewUser($name, $email) {
$segment_ids = Setting::getValue(
'subscribe.on_comment.segments',
'subscribe.on_register.segments',
array()
);