Jetpack contact form not working with do_shortcode()
-
I have encountered the same problem that was raised but not addressed in the thread, Jetpack Contact From not Sending when in do_shortcode.
Without success, I also tried the solution offered here: Resolved: Jetpack contact form submitting to weird places.
In the most basic terms, the Jetpack contact form works fine when I insert the shortcode into a post’s or page’s content via the UI text editor. However, if I want to use the Jetpack contact form shortcode in my template files using do_shortcode(), the form appears on the page but no email is sent and no message displays when submitting the form.
Looking at the contact module code, I happened upon this:
$form = Grunion_Contact_Form::$last; if ( !$form || ( is_wp_error( $form->errors ) && $form->errors->get_error_codes() ) ) { return; } // Process the form $form->process_submission();
$form is for some reason returning false whenever I use do_shortcode(), so process_submission() never runs. I have tested the same shortcode with do_shortcode() and in the default text editor, so I was able to verify that the shortcode works in the editor but not in do_shortcode(). Does anyone have thoughts on how to solve this problem?
- The topic ‘Jetpack contact form not working with do_shortcode()’ is closed to new replies.