WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Contact Form 7] Possible Solution to Recent Bugs

[Plugin: Contact Form 7] Possible Solution to Recent Bugs

  • Plugin Version: 3.1.1

    Problem:
    When I apply the code into my article, it renders as “404 Not Found”. I tried using the old syntax, played around with the syntaxes a bit (using titles, not using quote marks, etc), to no avail. So I dug in a little deeper…

    Solution:
    The plugin isn’t playing nicely with WP’s shortcode_atts() function. Not only are quote marks being sent as ", but now spaces can no longer be used in form titles. Go into the following file:

    /wp-content/plugins/contact-form-7/includes/controller.php

    Look around line 175, for function wpcf7_contact_form_tag_func(). A little further down, you’ll see this line:
    $atts = shortcode_atts( array( 'id' => 0, 'title' => '' ), $atts );

    Add the following two lines above it, so it appears so:

    $atts['id'] = str_replace(array('"','"'),'',$atts['id']);
    $atts['title'] = str_replace(array('"','"'),'',$atts['title']);
    $atts = shortcode_atts( array( 'id' => 0, 'title' => '' ), $atts );

    Also, if you have any forms that have spaces in their titles, you’ll need to recreate them using underscores (if you have access to your database you should be able to just edit the existing forms, not sure about this).

  • The topic ‘[Plugin: Contact Form 7] Possible Solution to Recent Bugs’ is closed to new replies.
Skip to toolbar