ID, '_kad_contact_form', true ); $map = get_post_meta( $post->ID, '_kad_contact_map', true ); $pageemail = get_post_meta( $post->ID, '_kad_contact_form_email', true ); $form_math = get_post_meta( $post->ID, '_kad_contact_form_math', true ); if ($form == 'yes') { ?> ID, '_kad_contact_address', true ); $maptype = get_post_meta( $post->ID, '_kad_contact_maptype', true ); $height = get_post_meta( $post->ID, '_kad_contact_mapheight', true ); $mapzoom = get_post_meta( $post->ID, '_kad_contact_zoom', true ); if(isset($pinnacle['google_map_api']) && !empty($pinnacle['google_map_api'])) { $gmap_api = $pinnacle['google_map_api']; } else { $gmap_api = 'AIzaSyBt7JOCM4XQTEi9jzdqB8alFc1Vm_3mbfQ'; } if(!empty($height)) { $mapheight = $height; } else { $mapheight = 300; } if(!empty($mapzoom)) { $zoom = $mapzoom; } else { $zoom = 15; } ?> #map_address {height:'.$mapheight.'px;}'; } if(isset($_POST['submitted'])) { if(isset($form_math) && $form_math == 'yes') { if(md5($_POST['kad_captcha']) != $_POST['hval']) { $kad_captchaError = __('Check your math.', 'virtue-toolkit'); $hasError = true; } } if(trim($_POST['contactName']) === '') { $nameError = __('Please enter your name.', 'virtue-toolkit'); $hasError = true; } else { $name = trim($_POST['contactName']); } if(trim($_POST['email']) === '') { $emailError = __('Please enter your email address.', 'virtue-toolkit'); $hasError = true; } else if (!is_email($_POST['email'])) { $emailError = __('You entered an invalid email address.', 'virtue-toolkit'); $hasError = true; } else { $email = trim($_POST['email']); } if(trim($_POST['comments']) === '') { $commentError = __('Please enter a message.', 'virtue-toolkit'); $hasError = true; } else { if(function_exists('stripslashes')) { $comments = stripslashes(trim($_POST['comments'])); } else { $comments = trim($_POST['comments']); } } if(!isset($hasError)) { if (isset($pageemail)) { $emailTo = $pageemail; } else { $emailTo = get_option('admin_email'); } $sitename = get_bloginfo('name'); $subject = '['.$sitename . ' ' . __("Contact", "kadencetoolkit").'] '. __("From", "kadencetoolkit") . ' ' . $name; $body = __('Name', 'virtue-toolkit').": $name \n\n"; $body .= __('Email', 'virtue-toolkit').": $email \n\n"; $body .= __('Comments', 'virtue-toolkit').":\n $comments"; $headers = 'Reply-To: ' . $name . '<' . $email . '>' . "\r\n"; wp_mail($emailTo, $subject, $body, $headers); $emailSent = true; } } ?>
ID, '_kad_contact_form_title', true ); if (!empty($contactformtitle)) { echo '

'. $contactformtitle .'

'; } if(isset($emailSent) && $emailSent == true) { ?>