• hello

    i want to use pipe for select option like
    [select name “name1|1”]
    the site show <option value=”name1″>name1</option>
    but i want <option value=”1″>name1</option>

    do you think why ?

    i’m using contact form 7 3.3.1
    in wp-contact-form-7.php there are lines :
    if ( ! defined( ‘WPCF7_USE_PIPE’ ) )
    define( ‘WPCF7_USE_PIPE’, true );

    thanks for your answer.

    http://wordpress.org/extend/plugins/contact-form-7/

Viewing 1 replies (of 1 total)
  • I have the same problem!

    I’m using this:
    [select country “AFG|Afghanistan” “ALB |Albania” …………… (many indeed). ….. .. .. ]

    Now this worked ok before last update! I’m very sure of it, But unfortunately I’m not sure what was the version before update 🙁

    I’ve fixed it in plugin source, but hope I won’t have to do it after next update.

    Here is what I changed:

    includes/pipe.php, line 55:
    ADD THIS

    function collect_afters() {
    	$afters = array();
    
    	foreach ( $this->pipes as $pipe ) {
    		$afters[] = $pipe->after;
    	}
    
    	return $afters;
    }

    END ADD

    includes/shortcodes.php
    CHANGE lines 113 – 123 like this:

    if ( WPCF7_USE_PIPE ) {
    	$pipes = new WPCF7_Pipes( $scanned_tag['raw_values'] );
    	$scanned_tag['values'] = $pipes->collect_befores();
    	$scanned_tag['pipes'] = $pipes;
    	$scanned_tag['labels'] = $pipes->collect_afters();
    } else {
    	$scanned_tag['values'] = $scanned_tag['raw_values'];
    	$scanned_tag['labels'] = $scanned_tag['values'];
    }
    
    // $scanned_tag['labels'] = $scanned_tag['values'];

    END CHANGE

    Now, I have no idea if that was a good thing to do or what, maybe the plugin author will enlighten us 🙂

    Cheers!

Viewing 1 replies (of 1 total)
  • The topic ‘select with pipe’ is closed to new replies.