Estoy usando WPCF7_Tubos clase para generar campos dinámicos en ‘tuberías’ Formulario de contacto 7 seleccione, pero necesito capturar los valores de tubería antes y después.
Este es mi código:
function select_country_cf7 ( $scanned_tag, $replace ) {
if ( $scanned_tag['name'] != 'country')
return $scanned_tag;
// end if
$rows = get_post_meta( get_the_ID(), 'country' );
if ( ! $rows )
return $scanned_tag;
// end if
foreach ( $rows as $row ) {
foreach ( $row as $country ) {
if($country == 'USA'){
$mail="myfirstmail@my_mail.com";
} // end if
else {
$mail="mysecondmail@my_mail.com";
} // end else
$scanned_tag['raw_values'][] = $country . '|' . $mail;
} // end foreach
} // end foreach
$pipes = new WPCF7_Pipes($scanned_tag['raw_values']);
$scanned_tag['values'] = $pipes->collect_befores();
$scanned_tag['pipes'] = $pipes;
return $scanned_tag;
}
add_filter( 'wpcf7_form_tag', 'select_country_cf7', 10, 2);
Como digo, el formulario se ve bien, pero cuando trato de capturar el valor de la opción a través de un WPCF7_Envío Por ejemplo, solo obtenga el país, pero también necesito recibir el correo.
.