is_posted() ) {
if ( isset( $_POST['_wpcf7_mail_sent'] ) && $_POST['_wpcf7_mail_sent']['ok'] )
$value = '';
else
$value = $_POST[$name];
} else {
$value = $values[0];
if ( ! empty( $content ) )
$value = $content;
}
$html = '';
$validation_error = '';
if ( is_a( $wpcf7_contact_form, 'WPCF7_ContactForm' ) )
$validation_error = $wpcf7_contact_form->validation_error( $name );
$html = '' . $html . $validation_error . '';
return $html;
}
wpcf7_add_shortcode( 'textarea', 'wpcf7_textarea_shortcode_handler', true );
wpcf7_add_shortcode( 'textarea*', 'wpcf7_textarea_shortcode_handler', true );
/* Validation filter */
function wpcf7_textarea_validation_filter( $result, $tag ) {
global $wpcf7_contact_form;
$type = $tag['type'];
$name = $tag['name'];
$_POST[$name] = (string) $_POST[$name];
if ( 'textarea*' == $type ) {
if ( '' == $_POST[$name] ) {
$result['valid'] = false;
$result['reason'][$name] = $wpcf7_contact_form->message( 'invalid_required' );
}
}
return $result;
}
add_filter( 'wpcf7_validate_textarea', 'wpcf7_textarea_validation_filter', 10, 2 );
add_filter( 'wpcf7_validate_textarea*', 'wpcf7_textarea_validation_filter', 10, 2 );
?>