pipes not working for elements – possible solution
-
I’ve been unable to get the pipes functionality (https://contactform7.com/selectable-recipient-with-pipes/) to work for a <select> element. The other support tickets related to this same problem have all been solved with workarounds. So, I went digging to see if I could figure out the problem. On line 313 of form-tags-manager.php is:
$scanned_tag['values'] = $pipes->collect_befores();
If this is changed to:
$scanned_tag['values'] = $pipes->collect_afters();
then the pipes start working as described in the above referenced article.
Is it possible to check into this as a possible solution to the problem I and others have been experiencing with the pipes functionality? Thanks much for your help!
EDIT: I take this back to some extent. It appears that this solution fixes the problem the first time the form is loaded. But in subsequent loads of the form, both the value and the label are the same once again. Could this be cache related? I think one of the other support tickets also mentioned this possibility.
EDIT #2:
Setting the ‘labels’ value within the pipes if/else appears to fix the issue:if ( WPCF7_USE_PIPE ) { $pipes = new WPCF7_Pipes( $scanned_tag['raw_values'] ); //$scanned_tag['values'] = $pipes->collect_befores(); $scanned_tag['values'] = $pipes->collect_afters(); $scanned_tag['pipes'] = $pipes; $scanned_tag['labels'] = $pipes->collect_befores(); } else { $scanned_tag['values'] = $scanned_tag['raw_values']; $scanned_tag['labels'] = $scanned_tag['values']; } //$scanned_tag['labels'] = $scanned_tag['values'];
- The topic ‘pipes not working for elements – possible solution’ is closed to new replies.