private function change_membership($user_id, $membership_id) { /** changing membership of the user **/ wpl_users::change_membership($user_id, $membership_id); $res = 1; $message = $res ? __('Operation was successful.', WPL_TEXTDOMAIN) : __('Error Occured.', WPL_TEXTDOMAIN); $data = NULL; $response = array('success' => $res, 'message' => $message, 'data' => $data); echo json_encode($response); exit; }