Contact form 7 call without shortcode
-
I need to call contact form 7 without the shortcode as it deals with my ajax function and shortcodes are not registered.
So in essence I want to echo the function that is hooked to that shortcode:
wpcf7_contact_form_tag_func();
I am taking info from the shortcode here:
[contact-form-7 id="4272" title="Variable Email Enquiry"]
So I can see there two parameters in the $args array – id and title
I tried this but nothing comes up:
function test_alternate_shortcode_2(){ $atts = array( 'id' => 4272, 'title' => 'Variable Email Enquiry'); //$cf7 = do_shortcode('[contact-form-7 id="4272" title="Variable Email Enquiry"]'); if(function_exists('wpcf7_contact_form_tag_func')){ echo wpcf7_contact_form_tag_func($atts); } else { echo 'referring incorectly'; } }
Where do I go from here?
- The topic ‘Contact form 7 call without shortcode’ is closed to new replies.