Forum Replies Created

Viewing 15 replies - 1 through 15 (of 37 total)
  • Thread Starter gyroscopic

    (@gyroscopic)

    Fixed this by changing where I applied my add_filter.

    Thread Starter gyroscopic

    (@gyroscopic)

    Ok I have made some progress here by changing my switch test to look not at $status but my own variable that I set correctly. This allows a correct message to be displayed – Hooray.

    However, I would still like to know how to set the form status to mail_failed and NOT mail_sent. This will then correctly trigger the Additional Settings for the form (namely the redirection on logging in on_sent_ok: "location.replace('//www.mysite.com');")

    I have tried using a filter with add_filter( 'wpcf7_validate', 'my_cf7_invalidate_login', 10, 2 ); to invalidate the form but its not setting the status at all (stays at ‘mail_sent’)

    The function is as above but with these changes…

    $result['valid'] = false;
      $result['status'] = 'mail_failed'; // my effort in changing status
      $result['reason']['username'] = 'Username or Password incorrect';

    Can someone please advise on how to change the form status flag or point to some decent documentation please.

    Thanks in advance

    Thread Starter gyroscopic

    (@gyroscopic)

    Sorry, not a problem with your plugin :/

    Thread Starter gyroscopic

    (@gyroscopic)

    Actually, it would be better if I could just disable the auto download entirely . That way I can change the landing page to include my form with a button that will down load directly.

    Is there a way to disable auto download? I know you can change the timeout – what about -1 to disable it?

    Can you tell us please, otherwise its a waste of a post.

    I’m actually trying to do this as well.

    Thread Starter gyroscopic

    (@gyroscopic)

    Actually I need to add data-step=”0.5″ not step=”0.5″, but the question still stands, how do you add (arbitrary) attributes to an input for CF7?

    Thread Starter gyroscopic

    (@gyroscopic)

    Since v3.9 the above fix needs some changes as shown below;

    Now in contact-form.php (classes.php has been removed in v3.9)

    /**
    		 * Start - Allow classes to be added to wrapper div...
    		 * ---------------------------------------------------
    		 */
    		/* ORIG: $html = sprintf( '<div %s>', wpcf7_format_atts( array(
    			'class' => 'wpcf7',
    			'id' => $this->unit_tag,
    			( get_option( 'html_type' ) == 'text/html' ) ? 'lang' : 'xml:lang'
    				=> str_replace( '_', '-', $this->locale ),
    			'dir' => wpcf7_is_rtl( $this->locale ) ? 'rtl' : 'ltr' ) ) ) . "\n";
    		*/
    		$wrapper_class = 'wpcf7';
    		if ( $atts['div_class'] ) {
    			$wrapper_class .= ' ' . $atts['div_class'];
    		}
    
    		$html = sprintf( '<div %s>', wpcf7_format_atts( array(
    			'class' => $wrapper_class,
    			'id' => $this->unit_tag,
    			( get_option( 'html_type' ) == 'text/html' ) ? 'lang' : 'xml:lang'
    				=> str_replace( '_', '-', $this->locale ),
    			'dir' => wpcf7_is_rtl( $this->locale ) ? 'rtl' : 'ltr' ) ) ) . "\n";
    		/**
    		 * END - Allow classes to be added to wrapper div...
    		 * ---------------------------------------------------
    		 */

    Place the above code around line 261 (it replaces the line in ORIG: above)

    ANY CHANCE THE AUTHOR CAN ADD THIS TO THE PLUGIN?????
    He obviously forgot last time!

    Thread Starter gyroscopic

    (@gyroscopic)

    Fixed

    Thread Starter gyroscopic

    (@gyroscopic)

    Well I checked out the plugin code to see how it works and from that it seems there is no (current) way to add classes to the wrapper div.

    So I added my own code to facilitate this.

    It works the same way the ‘add class to form tag’ code works for the html_class shortcode attribute.

    I had to add a new attribute to the list in both classes.php and controller.php and then add a test for extra classes in the classes.php file…

    public function form_html( $atts = array() ) {
    		$atts = wp_parse_args( $atts, array(
    			'html_id' => '',
    			'html_name' => '',
    			'html_class' => '',
    			'div_class' => '' // Wrapper - Allow classes to be added to wrapper div...
    			 ) );
    
    		$this->unit_tag = self::get_unit_tag( $this->id );
    
    		/**
    		 * Start - Allow classes to be added to wrapper div...
    		 * ---------------------------------------------------
    		 */
    		// ORIG: $html = '<div class="wpcf7" id="' . $this->unit_tag . '">' . "\n";
    		$wrapper_class = 'wpcf7';
    		if ( $atts['div_class'] ) {
    			$wrapper_class .= ' ' . $atts['div_class'];
    		}
    		$html = '<div class="' . $wrapper_class . '" id="' . $this->unit_tag . '">' . "\n";
    		/**
    		 * END - Allow classes to be added to wrapper div...
    		 * ---------------------------------------------------
    		 */

    All you have to do is then call the shortcode with the extra attribute and class eg

    [contact-form-7 id="222" div_class="container"]

    the new attribute is div_class

    Maybe the plugin Author can include this in a future update?

    Thread Starter gyroscopic

    (@gyroscopic)

    Hi Danny

    Thanks for getting back to me. I resolved this by removing the bit of code that adds an ‘s’ to the url.

    When I get more time I will try the newer version instead.

    Many thanks for your great plugin!

    Thread Starter gyroscopic

    (@gyroscopic)

    Upon further investigation the problem seems to be related to the fact that the plugin thinks the site is using https not http – yet the site is plain http (non secure) – any ideas?

    Thread Starter gyroscopic

    (@gyroscopic)

    Ok the messages are there just overflow was hidden.

    I would like to just enter a name field without using firstname or lastname is this an option?

    Thread Starter gyroscopic

    (@gyroscopic)

    I put a zero ‘0’ in the redirect field, and have also tried it empty. The messages are all the default ones so far – but still nothing in the form.

    Thread Starter gyroscopic

    (@gyroscopic)

    Hi Danny

    All fixed. I’m amending a clients original theme and it had a script which made the whole form clickable via a class. Removed the class and the form now works.

    BTW as I have set it to not redirect I dont see the confirmation message anywhere – should these display in the form?

    Also thanks for the quick reply!

    Thread Starter gyroscopic

    (@gyroscopic)

    Many thanks – figured it out eventually, but great to see the plugin progressing 🙂

Viewing 15 replies - 1 through 15 (of 37 total)