Dropdown problem with pipes
-
Hi,
I found a possible bug inside the code that manages pipes within data in dropdowns.
For example, your dropdown example from Selectable Recipient doesn’t work as expected.
[select your-recipient "CEO|[email protected]" "Sales|[email protected]" "Support|[email protected]"]
Renders this code:
<select name="your-recipient" class="wpcf7-form-control wpcf7-select" aria-invalid="false"> <option value="CEO">CEO</option> <option value="Sales">Sales</option> <option value="Support">Support</option> </select>
When I think it should render this code:
<select name="your-recipient" class="wpcf7-form-control wpcf7-select" aria-invalid="false"> <option value="[email protected]">CEO</option> <option value="[email protected]">Sales</option> <option value="[email protected]">Support</option> </select>
I fixed this on /includes/shortcodes.php file, line 147 to 155. Replacing this code:
if ( WPCF7_USE_PIPE ) { $pipes = new WPCF7_Pipes( $scanned_tag['raw_values'] ); $scanned_tag['values'] = $pipes->collect_befores(); $scanned_tag['pipes'] = $pipes; } else { $scanned_tag['values'] = $scanned_tag['raw_values']; } $scanned_tag['labels'] = $scanned_tag['values'];
With this:
if ( WPCF7_USE`_PIPE ) {
$pipes = new WPCF7_Pipes( $scanned_tag[‘raw_values’] );
$scanned_tag[‘values’] = $pipes->collect_afters();
$scanned_tag[‘labels’] = $pipes->collect_befores();
$scanned_tag[‘pipes’] = $pipes;
} else {
$scanned_tag[‘values’] = $scanned_tag[‘raw_values’];
$scanned_tag[‘labels’] = $scanned_tag[‘values’];
}`Do you agree with that?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Dropdown problem with pipes’ is closed to new replies.