unit_tag == $_POST['_wpcf7_unit_tag'] )
return true;
return false;
}
function clear_post() {
$fes = $this->form_scan_shortcode();
foreach ( $fes as $fe ) {
if ( ! isset( $fe['name'] ) || empty( $fe['name'] ) )
continue;
$name = $fe['name'];
if ( isset( $_POST[$name] ) )
unset( $_POST[$name] );
}
}
/* Generating Form HTML */
function form_html() {
$form = '
';
$url = wpcf7_get_request_uri();
if ( $frag = strstr( $url, '#' ) )
$url = substr( $url, 0, -strlen( $frag ) );
$url .= '#' . $this->unit_tag;
$url = apply_filters( 'wpcf7_form_action_url', $url );
$enctype = apply_filters( 'wpcf7_form_enctype', '' );
$class = apply_filters( 'wpcf7_form_class_attr', 'wpcf7-form' );
$form .= '
';
$form .= '
';
return $form;
}
function form_response_output() {
$class = 'wpcf7-response-output';
$content = '';
if ( $this->is_posted() ) { // Post response output for non-AJAX
if ( isset( $_POST['_wpcf7_mail_sent'] ) && $_POST['_wpcf7_mail_sent']['id'] == $this->id ) {
if ( $_POST['_wpcf7_mail_sent']['ok'] ) {
$class .= ' wpcf7-mail-sent-ok';
$content = $_POST['_wpcf7_mail_sent']['message'];
} else {
$class .= ' wpcf7-mail-sent-ng';
if ( $_POST['_wpcf7_mail_sent']['spam'] )
$class .= ' wpcf7-spam-blocked';
$content = $_POST['_wpcf7_mail_sent']['message'];
}
} elseif ( isset( $_POST['_wpcf7_validation_errors'] ) && $_POST['_wpcf7_validation_errors']['id'] == $this->id ) {
$class .= ' wpcf7-validation-errors';
$content = $this->message( 'validation_error' );
}
} else {
$class .= ' wpcf7-display-none';
}
$class = ' class="' . $class . '"';
return '' . $content . '
';
}
function validation_error( $name ) {
if ( ! $this->is_posted() )
return '';
if ( ! isset( $_POST['_wpcf7_validation_errors']['messages'][$name] ) )
return '';
$ve = trim( $_POST['_wpcf7_validation_errors']['messages'][$name] );
if ( ! empty( $ve ) ) {
$ve = '