Skip to content

Instantly share code, notes, and snippets.

@zxcnasab
zxcnasab / functions.php
Last active July 27, 2020 06:01
Modify CF7 Data Before Submission
<?php
add_action( 'wpcf7_before_send_mail', 'wpcf7_custom_data', 90, 1 );
function wpcf7_custom_data( $WPCF7_ContactForm ){
// Submission object, that generated when the user click the submit button.
$submission = WPCF7_Submission :: get_instance();
if ( $submission ){
$posted_data = $submission->get_posted_data();
using HtmlAgilityPack;
using System;
using System.IO;
using System.Linq;
using System.Threading;
namespace HTML_to_PHP
{
class Program
{