/** * Subscribes the provided user ID's * Returns the updates progress */ protected function subscribe_users() { // make sure `user_ids` is an array $user_ids = $_REQUEST['user_ids']; if (!is_array($user_ids)) { $user_ids = sanitize_text_field($user_ids); $user_ids = explode(',', $user_ids); } $result = $this->wizard->subscribe_users($user_ids); if ($result) { $this->respond(array('success' => true)); } // send response $this->respond(array('success' => $result, 'error' => $this->wizard->get_error())); }