function handle_notes() { $users_events = new ES_DB_UsersEvents(); $event = new stdClass(); $event->ID = $_POST['event_id']; $user = new stdClass(); $user->ID = $_POST['user_id']; $content = $_POST['content']; echo $users_events->update_user_reminder($user, $event, $content); exit; //always call exit at the end of a WordPress ajax function }