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() { function welcome() {
if((bool)(defined('DOING_AJAX') && DOING_AJAX)) return;
global $wp; global $wp;
$current_url = home_url(add_query_arg($wp->query_string, $wp->request)); $current_url = home_url(add_query_arg($wp->query_string, $wp->request));
$redirect_url = $redirect_url =

View File

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