Really? It’s working on my site. I’m using WP 2.8 + CF7 1.10.0.1.
I found a couple of bugs in wp-contact-form-7.php.
1) in function wpcf7_plugin_url( $path = ” )
global $wp_version;
Needs to be added before the first if statement so that the variable is available within that function.
2) in function wpcf7_enqueue_scripts()
TRUE should be removed as a parameter passed to wp_enqueue_script as it’s not a valid parameter.
FYI, the whole point is that w/ those bugs the necessary JS files do not get included on the page via wp_head() in the templates.
1) in function wpcf7_plugin_url( $path = ” )
global $wp_version;
Needs to be added before the first if statement so that the variable is available within that function.
oops. I forgot the global declaration. Thanks jinkim.
2) in function wpcf7_enqueue_scripts()
TRUE should be removed as a parameter passed to wp_enqueue_script as it’s not a valid parameter.
The fifth parameter of wp_enqueue_script
is supported from WP 2.8.
http://core.trac.wordpress.org/browser/tags/2.8/wp-includes/functions.wp-scripts.php#L82
When the value is set as true, the script will be included in the footer, instead of the header.
Thread Starter
digitz
(@digitz)
Takayuki,
Would you please issue a patch for this problem?
Thread Starter
digitz
(@digitz)
Still, this fix didn’t help with the AJAX issue.
Submit button isn’t disabled before confirming the “terms” checkbox, plus AJAX is not functioning, in other words, the whole page refreshes after the form is submitted.
Maybe there are some JavaScript conflicts on your site. Can I see the site so I can point out the conflicts?
Thread Starter
digitz
(@digitz)
Takayuki, but it was working great on WP 2.7.1
Upgrading to WP 2.8 messed things up.
Oh, sorry! I forgot to mention this.
Since WP2.8, the javascripts of Contact Form 7 are loaded in the footer of the pages, instead of header. So you need to call wp_footer() in the footer.php of your using template, like wp_header() in header.php.
This article describes it in detail.
Loading JavaScript In Footer In WordPress 2.8
Thread Starter
digitz
(@digitz)
I inserted the following code at the top of my footer.php:
<?php wp_footer(); ?>
But still no use.
Okay, the javascripts came to be shown on the footer. Now another problem is conflict with other javascripts. By looking at the HTML source, jQuery.js is loaded twice (line #15 and #218), and FireBug shows error in the slider.js (#219). They are blocking the javascripts of Contact Form 7 from working.
I’m having the same problem re: Ajax. The forms submit and I get the emails, but the “your form was sent, etc” notice isn’t working; the form just refreshes.
wp_footer(); is called in the footer. jQuery.js is called in the head and jQuery.form.js in the footer. I’ve tried removing them (first one, then the other), and it breaks the plugin, so I’m all out of ideas.