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;
}
*/
//
if (function_exists('cfshoppingcart_ContactForm7')) {
// $b is true or false
list($b, $value) = cfshoppingcart_ContactForm7($cf_opt);
} else {
list($b, $value) = 'Function cfshoppingcart_ContactForm7 is not found.';
}
$value = esc_html( $value );
//print_r($cf_opt);
//echo 'value = ' . $value;
$html .= '';
//if (array_key_exists('hidden', $cf_opt)) {
if (isset($cf_opt['hidden'])) {
if ($b) {
$html .= '';
} else {
//echo $value;
//$html .= '
' . $value . '
';
$html .= '';
}
} else {
if ($b) {
$html .= '';
} else {
$html .= '' . $value . '
';
$html .= '';
}
}
$validation_error = '';
if ( is_a( $wpcf7_contact_form, 'WPCF7_ContactForm' ) )
$validation_error = $wpcf7_contact_form->validation_error( $name );
$html = '' . $html . $validation_error . '';
//echo '3: ' . $html;
return $html;
}
/* Validation filter */
add_filter( 'wpcf7_validate_cfshoppingcart', 'wpcf7_cfshoppingcart_validation_filter', 10, 2 );
add_filter( 'wpcf7_validate_cfshoppingcart*', 'wpcf7_cfshoppingcart_validation_filter', 10, 2 );
function wpcf7_cfshoppingcart_validation_filter( $result, $tag ) {
global $wpcf7_contact_form;
$type = $tag['type'];
$name = $tag['name'];
$_POST[$name] = (string) $_POST[$name];
if ( 'cfshoppingcart*' == $type ) {
if ( '' == $_POST[$name] ) {
$result['valid'] = false;
$result['reason'][$name] = $wpcf7_contact_form->message( 'invalid_required' );
}
}
return $result;
}
?>