• I’m having issues where by the contact form 7 plugin is still automatically inserting <p> and <br> into my contact forms. I’ve added the:

    define( 'WPCF7_AUTOP', false );

    into my wp-config.php file with no avail. (in the correct position)

    i’ve even tried to delete the entire autop function from the cf7 formatting php file and still nothing.

    I’m really confused as that first define snippet has worked for others in the fast. any ideas?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    i’ve even tried to delete the entire autop function from the cf7 formatting php file and still nothing.

    This means that what is inserting <p> and <br> into your content is obviously not Contact Form 7.

    Try deactivating all other plugins and switching to the default theme, then you’ll find the real cause.

    ok i commented the function wpcf7_auto out, and it still does insert <p></p> at any selection, radios and simple textfields.

    as i could i figuered out, this strange behaviour began some day between 19. July and 27 July this year.

    The only update that i made in that period was updating twenty ten (that i dont use). Im not sure if that is related to the <p> problem.

    my wordpress and php skills aren’t strong so i couldnt proof that.

    it seems that the option “html content type” causes the <p> problem.
    I did remove all html tags inside the message and if i turn on this option the email is “contaminated” with all that additional <p>. if i turn off the option, the mail looks fine.

    Clay

    (@cletustboone)

    It seems that noyse is on to something here. I noticed this issue with the introduction of Contact Form 7, version 2.3 on WordPress 2.9.2. My HTML content emails kept automatically wrapping the form values with paragraph tags. I tried setting the WPCF7_AUTOP constant in the wp-config.php file. I tried forcing it to true in the wp-contact-form-7.php file. I tried making the wpcf7_autop function simply return the value passed to it, to no avail. So, it seems like something else is adding those paragraph tags. But, I reverted back to version 2.2.1 and the problem disappeared. So, if the problem is occurring because something else is adding the tags, then it has something to do with Contact Form 7, otherwise the problem wouldn’t disappear by reverting to an older version.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Wrong paragraph formatting of HTML-mail content is a known issue. Try the development version.

    http://downloads.wordpress.org/plugin/contact-form-7.zip

    Aprea was mentioning about another issue, formatting of contact form itself.

    hi Takayuki
    i will try it. i didnt know that was a known issue.

    Aprea was mentioning about another issue, formatting of contact form itself.

    ahh okay that happen when the last english lessons are 20 years ago 🙂

    I posted a solution that works when you’re using HTML e-mail:

    add_filter("wpcf7_mail_tag_replaced", "suppress_wpcf7_filter");
    function suppress_wpcf7_filter($value, $sub = ""){
    	$out	=	!empty($sub) ? $sub : $value;
    	$out	=	strip_tags($out);
    	$out	=	wptexturize($out);
    	return $out;
    }

    And then, BAM, everything was being formatted the way I intended it to.

    EDIT: Okay, sweet; just noticed that there was an update available that fixed this wretched problem. Thanks!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Plugin: Contact Form 7] Automatically inserts paragraph tags’ is closed to new replies.