• Resolved lucadiba

    (@lucadiba)


    Hello,

    Is this still possible in CF7? I’ve tried to use that syntax but the value attribute is the same as the shown value (i.e., what is before the pipe).

    [select* data-nascita-mese "gennaio|01" "febbraio|02" "marzo|03" "aprile|04" "maggio|05" "giugno|06" "luglio|07" "agosto|08" "settembre|09" "ottobre|10" "novembre|11" "dicembre|12"]

    Thank you,
    Luca

Viewing 3 replies - 1 through 3 (of 3 total)
  • @lucadiba
    I’ve had the same issue today. I think it is broken. Here is a fix that worked for me:

    Go into wp-content > plugins > contact-form-7 > includes > form-tags-manager.php [line 311] and replace the conditional with this. Make sure you are also commenting out or deleting the $scanned_tag[‘labels’] line after the conditional.

    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'];
    • This reply was modified 3 years, 7 months ago by blastframe.
    Thread Starter lucadiba

    (@lucadiba)

    Thank you @blastframe, I confirm that your code works correctly. I have referenced you on the GitHub issue that I just opened and made a pull request to fix the bug… hopefully it will be solved in the next release.

    Thanks again! ??

    Thread Starter lucadiba

    (@lucadiba)

    Update: this is not a bug – it is intended (read here).
    Then, it would be nice a feature that changed the value of the option. Using the current method, a plugin that uses JS to take the value of the select does not work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Select with pipes’ is closed to new replies.