function newPost() { //Read form data $new_post = maybe_unserialize(base64_decode($_POST['new_post'])); $post_custom = maybe_unserialize(base64_decode($_POST['post_custom'])); $post_category = rawurldecode(isset($_POST['post_category']) ? base64_decode($_POST['post_category']) : null); $post_tags = rawurldecode(isset($new_post['post_tags']) ? $new_post['post_tags'] : null); $post_featured_image = base64_decode($_POST['post_featured_image']); $upload_dir = maybe_unserialize(base64_decode($_POST['mainwp_upload_dir'])); if (isset($_POST['_ezin_post_category'])) { $new_post['_ezin_post_category'] = maybe_unserialize(base64_decode($_POST['_ezin_post_category'])); } $res = MainWP_Helper::createPost($new_post, $post_custom, $post_category, $post_featured_image, $upload_dir, $post_tags); $created = $res['success']; if (true !== $created) { MainWP_Helper::error($created); } $information['added'] = true; $information['added_id'] = $res['added_id']; $information['link'] = $res['link']; MainWP_Helper::write($information); }