The vars are named in Dutch. As far as I can see this never gets executed. I now wonder should this be executed with the additional setting “on_sent_ok:” ?
Child functions.php:
<?php
add_action( 'wpcf7_mail_sent', 'vhv_kortdag_function' );
function vhv_kortdag_function( $contact_form ) {
global $kortdag;
$kortdag ='';
$form_title = $contact_form->title; // Used as check only
$posted_data = $contact_form->posted_data;
$aankomstdatum = $posted_data['vhv_dat_aankomst'];
$vandaagdatum = date("d-m-Y");
$vandaag = strtotime($vandaagdatum);
$aankomst = strtotime($aankomstdatum);
if ( $aankomst <= ($vandaag + 10) )
{
$kortdag = '<span style="color: #ff0000;"><strong>Attentie:</strong> indien uw aankomst binnen 10 dagen vanaf heden valt verzoeken wij u óók even te bellen met het telefoonnummer zoals vermeld op de <a href="//www.vakantiehuisverhuur.eu/contact/"" title=""Ga">contactpagina</a> !</span>';
}
}
?>
In my contact (booking) page I have an include with my globals:
require_once (ABSPATH . 'wp-content/themes/vhv-eu_child-theme/vhv_include.php');
AND This:
$kortdag ='.'; // (global)
Then at the bottom in my contact-page I use the global var to display the message:
echo "<br />" . $kortdag;
The CF7 shortcode is used in PHP as I use the “PHP Execution” plugin to execute in-line PHP. This works all very well to populate the page.
Si I have a contact form running okay but I am now putting in additional validation and function.
Example:
Thanks again,