Change newsletter and template saving to JSON encode body separately

This commit is contained in:
Tautvidas Sipavičius
2016-01-11 18:27:30 +02:00
parent ffc1d0a61c
commit b7cfa549d5
6 changed files with 89 additions and 37 deletions

View File

@@ -30,10 +30,6 @@ class NewsletterTemplates {
}
function save($data = array()) {
if (isset($data['body'])) {
$data['body'] = json_encode($data['body']);
}
$result = NewsletterTemplate::createOrUpdate($data);
if($result !== true) {
wp_send_json($result);

View File

@@ -59,10 +59,6 @@ class Newsletters {
unset($data['options']);
}
if (isset($data['body'])) {
$data['body'] = json_encode($data['body']);
}
$errors = array();
$result = false;