unit_tag == $_POST['_wpcf7_unit_tag'] )
return true;
return false;
}
/* Generating Form HTML */
function form_html() {
$form = '
';
$url = parse_url( $_SERVER['REQUEST_URI'] );
$url = $url['path'] . ( empty( $url['query'] ) ? '' : '?' . $url['query'] ) . '#' . $this->unit_tag;
$enctype = apply_filters( 'wpcf7_form_enctype', '' );
$form .= '
';
$form .= '
';
return $form;
}
function form_response_output() {
$class = 'wpcf7-response-output';
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() && $ve = $_POST['_wpcf7_validation_errors']['messages'][$name] )
return '