Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter Stagger Lee

    (@stagger-lee)

    It even mess with all input fields (styling) after conditional field. And mess with styling (or more, completely gone) select fields, if they are conditional fields. Tried to resave form but did not help.

    Everything was nice before yesterday update.

    Thread Starter Stagger Lee

    (@stagger-lee)

    It is this function and regex there making it:

    wpcf7cf_properties

    Dont know why it mess with button. For other fields I use Bootstrap “group” classes. You have to assume Bootstrap is very popular and plugin will ruin it.

    Rename your shortcode attributes, not big deal.
    Instead of “group group-830” it can be “cf-group cf-group-830”

    Plugin Author Jules Colle

    (@jules-colle)

    Good point. I’ll try to figure out a solution without having to rename the shortcodes though, because it will break all code for the people who update.

    Plugin Author Jules Colle

    (@jules-colle)

    @stagger-lee Would you mind checking if this code works? I simplified the regex a little bit. If it doesn’t help, would you mind pasting the form code you are using?

    Please just replace the wpcf7cf_properties function at line 152 contact-form-7-conditional-fields.php

    function wpcf7cf_properties($properties, $wpcf7form) {
    	if (!is_admin()) {
    		$form = $properties['form'];
    
    		$find = array(
    			'/\[group\s?([^\s\]]*)\s?(.*?)\]/s',
    			'/\[\/group\]/s'
    		);
    
    		$replace = array(
    			'<div id="$1" data-class="wpcf7cf_group">',
    			'</div>'
    		);
    
    		$form = preg_replace( $find, $replace, $form );
    
    		$properties['form'] = $form;
    	}
    	return $properties;
    }
    Plugin Author Jules Colle

    (@jules-colle)

    Or this one might be even better:

    function wpcf7cf_properties($properties, $wpcf7form) {
    	if (!is_admin()) {
    		$form = $properties['form'];
    
    		$find = array(
    			'/\[group\s*([^\s\]]*)\s*([^\]]*)\]/s',
    			'/\[\/group\]/s'
    		);
    
    		$replace = array(
    			'<div id="$1" data-class="wpcf7cf_group">',
    			'</div>'
    		);
    
    		$form = preg_replace( $find, $replace, $form );
    
    		$properties['form'] = $form;
    	}
    	return $properties;
    }
    Plugin Author Jules Colle

    (@jules-colle)

    So sorry for the multiple posts. But I think this one would be even better, since it wouldn’t match tags like [grouping group-1]

    function wpcf7cf_properties($properties, $wpcf7form) {
    	if (!is_admin()) {
    		$form = $properties['form'];
    
    		$find = array(
    			'/\[group\s*\]/s', // matches [group    ] or [group]
    			'/\[group\s+([^\s\]]*)\s*([^\]]*)\]/s', // matches [group something some:thing] or [group   something  som   ]
    			                                        // doesn't match [group-special something]
    			'/\[\/group\]/s'
    		);
    
    		$replace = array(
    			'<div data-class="wpcf7cf_group">',
    			'<div id="$1" data-class="wpcf7cf_group">',
    			'</div>'
    		);
    
    		$form = preg_replace( $find, $replace, $form );
    
    		$properties['form'] = $form;
    	}
    	return $properties;
    }
    Plugin Author Jules Colle

    (@jules-colle)

    I updated the plugin with above code for version 0.1.4. Please let me know if it works for you

    Thread Starter Stagger Lee

    (@stagger-lee)

    @jules I am sincerely sorry. I did not get those 4-5 e-mail notifications for your comments. Or maybe I have, but strange I would ignore all 4. Dont know now, maybe my memory is bad or some glitch in WP servers.

    All is OK now, you can mark it as solved. All is OK with latest update.

    Plugin Author Jules Colle

    (@jules-colle)

    No problem 😉 glad it worked out for you

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Plugin influence CF7 Send button style’ is closed to new replies.