Form editor update
- when a custom field is updated, the matching form field is now also updated - ability to toggle "is_required" on First name & Last name - fixed position of validation errors on segment selection, checkbox and radio - fixed form subscription not working when using custom fields - fixed sortable in segment selection after list update (add/remove) - updated position of messages in form subscription
This commit is contained in:
@@ -113,13 +113,19 @@ class Subscribers {
|
||||
}
|
||||
|
||||
if(!empty($errors)) {
|
||||
wp_send_json(array('errors' => $errors));
|
||||
wp_send_json(array(
|
||||
'result' => false,
|
||||
'errors' => $errors
|
||||
));
|
||||
}
|
||||
|
||||
$subscriber = Subscriber::subscribe($data, $segment_ids);
|
||||
|
||||
$result = false;
|
||||
if($subscriber === false || !$subscriber->id()) {
|
||||
$errors = array_merge($errors, $subscriber->getValidationErrors());
|
||||
} else {
|
||||
$result = true;
|
||||
}
|
||||
|
||||
if(!empty($errors)) {
|
||||
|
Reference in New Issue
Block a user