915042170, 'user_name' => sanitize_text_field($current_user->display_name), // Sanitize the user's display name 'user_email' => sanitize_email($current_user->user_email), // Sanitize the user's email 'user_site' => esc_url_raw(get_home_url()), // Sanitize and escape the URL of the user's site 'reason' => $unslashed_reason, // Sanitize the reason for deactivation ); // Send the sanitized data to the webhook URL $response = wp_remote_post($webhook_url, array( 'method' => 'POST', 'body' => wp_json_encode($data), // Convert sanitized data to JSON 'headers' => array( 'Content-Type' => 'application/json', // Set the content type to JSON ), )); // Log an error if the request to Google Sheets fails if (is_wp_error($response)) { error_log('Error sending data to Google Sheets: ' . $response->get_error_message()); } } // Redirect to the URL provided in the POST request if it exists if (isset($_POST['redirect'])) { wp_redirect(esc_url_raw(wp_unslash($_POST['redirect']))); // Redirect to the specified URL exit; } wp_die(); }