sanitize_text_field($pushover_token), 'user' => sanitize_text_field($pushover_user), 'title' => sanitize_text_field($atts['subject']), 'message' => wp_kses_post($atts['message']), ]; // Send the message to Pushover using the WordPress HTTP API // This will make a POST request to the Pushover API with the prepared message data $response = wp_remote_post('https://api.pushover.net/1/messages.json', [ 'body' => $message, ]); // Check if the response is a WP_Error object // This indicates that an error occurred during the request if (is_wp_error($response)) { // Log the error message for debugging purposes error_log('Pushover notification failed: '. $response->get_error_message()); } // Return false to prevent wp_mail from sending the email // This will effectively redirect the email to Pushover return false; }