WordPress
- 3 ответа
- 0 вопросов
0
Вклад в тег
add_action( 'wpcf7_before_send_mail', function($contact_form) {
$submission = WPCF7_Submission::get_instance();
$posted_data = $submission->get_posted_data();
$mail = $contact_form->prop( 'mail' );
$city = do_shortcode('[wt_geotargeting get="city"]');
$mail['body'] = str_replace('[wz_city]', $city, $mail['body']);
$mail['body'] .= $city;
$contact_form->set_properties( array( 'mail' => $mail ) );
return $contact_form;
});