wpc7_form_tag
-
function dynamic_select_field_values ( $scanned_tag, $replace ) { //Si il y a un pilote if( isset ($_SESSION["pilote"]) AND !empty($_SESSION["pilote"]) ){ $current_pilote=$_SESSION["pilote"]; if($scanned_tag['name'] != 'aile') return $scanned_tag; $rows = get_posts( array ( 'post_type' => $current_pilote, 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC' ) ); if(!$rows) return $scanned_tag; foreach($rows as $row) { $scanned_tag['raw_values'][] = $row->post_title . '|' . $row->post_title; } $pipes = new WPCF7_Pipes($scanned_tag['raw_values']); $scanned_tag['values'] = $pipes->collect_befores(); $scanned_tag['pipes'] = $pipes; return $scanned_tag; } //Si il n'y a pas de pilote $current_pilote="nc"; if($scanned_tag['name'] != 'aile') return $scanned_tag; $rows = get_posts( array ( 'post_type' => $current_pilote, 'numberposts' => -1, 'orderby' => 'title', 'order' => 'ASC' ) ); if(!$rows) return $scanned_tag; foreach($rows as $row) { $scanned_tag['raw_values'][] = $row->post_title . '|' . $row->post_title; } $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', 'dynamic_select_field_values', 10, 2);
Hello Contact Form 7 specialists,
since 5.9 update this code doesn’t work any more!
$current_pilote=$_SESSION[“pilote”]; seems to be the issue.
if I use $current_pilote=”jack”;
it works like before but that’s not what I want….
Help !
(mean time I backed up to 5.8.7 in order to be able to keep using my website)
Thanks
Jacques from Grenoble FranceThe page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wpc7_form_tag’ is closed to new replies.