Tag Info

Hot answers tagged

10

There's two ways to do what you're wanting. First way is to add this code to functions.php of the Contact Form 7 plugin: add_filter( 'wpcf7_form_elements', 'mycustom_wpcf7_form_elements' ); function mycustom_wpcf7_form_elements( $form ) { $form = do_shortcode( $form ); return $form; } That allows you to drop shortcodes directly into CF7. Second is to ...


6

It looks like this is supported by Contact Form 7 natively, it's just not very obvious on how to make it happen. Here's a documentation page explaining the functionality: http://contactform7.com/selectable-recipient-with-pipes/ Basically all you have to do is put the values like so: Visible Value|actual-form-value What comes before the pipe "|" character ...


6

Take a look at the wpcf7_before_send_mail hook CF7 provides. add_action("wpcf7_before_send_mail", "wpcf7_do_something_else_with_the_data"); function wpcf7_do_something_else_with_the_data(&$wpcf7_data) { // Everything you should need is in this variable var_dump($wpcf7_data); // I can skip sending the mail if I want to... ...


5

You haven't given enough information, so it might have something to do with javascript conflicts, files not loading, server SMTP, etc. Best thing to do is work through the Contact Form 7 issues FAQ at contactform7.com/faq/


5

WP Ajax runs both public as well as closed calls via admin.php. This means that you don't have access to the whole wp environment, such as do_shortcode(), which is inside /wp-includes/shortcodes.php.


4

Well without more code it's hard to tell but one thing is you are wrapping a shortcode with php tags. My guess is you have error logs turned off or you'd see Santax error unexpected '[' on line XXX If you are using the post/page editor you want to use[contact-form-7 id="181" title="Contact form 1"] (see no php tags) If you really want to use php tags (or ...


3

Use Pipes. See the FAQ: http://contactform7.com/selectable-recipient-with-pipes/ I.e.: [select your-recipient "CEO|ceo@example.com" "Sales|sales@example.com" "Support|support@example.com"]


3

Here's how to do it: http://wordpress.org/support/topic/contact-form-7-sending-attachments-without-user-upload


3

I'd say this question is mostly off-topic since it's not WordPress-specific. Mostly, because the majority of PHP solutions out there use sessions, which will not work out-of-the-box in WordPress. Google search actually handles this question quite well. Have a look at this discussion for nice techniques. Finally, Contact Form 7 has Captcha built-in.


3

In Additional Settings, use on_sent_ok: "location = 'http://example.com/';" to redirect to another page, but as said above, it's not that secure. You can hide the page via robots.txt.


3

simply add you JavaScript function to your page then find the Additional Settings field at the bottom of the contact form management page and use the on_sent_ok JavaScript action hook like so: on_sent_ok: "MY_JavaScript_function_Name();"


3

Check your CPANEL to make sure mail isnt going to a local mailbox. despite any MX settings, if you have a remote mailbox somewhere else, mail sent from wordpress will first go to any local mailbox. you must disable this in CPANEL/mx entry maintenance. this solved my issue.


3

You're doing it wrong. get_currentuserinfo() returns the data into some preset global variables. Try this: function outta_here() { global $user_ID; get_currentuserinfo(); wp_delete_user($user_ID); } add_action( 'wpcf7_before_send_mail', 'outta_here' ); You can read more about get_currentuserinfo() on WP Codex.


3

Could somebody explain why it's advised never to load wp-admin/admin.php in your plugin and how it could cause issues? Because it is loading WordPress out of context-- well, parts of WordPress. And that can cause unexpected effects such as functions not being loaded or functions being loaded twice (which will cause fatal errors). You will have trouble ...


3

You can use my plugin called MailChimp for WordPress to do this. When installed, you can select one or multiple lists in the plugin settings and use the following shortcode inside your Contact Form 7 templates. [mc4wp_checkbox "Your label text"] It will render a checkbox and when checked, subscribe the given email address to the MailChimp lists you ...


2

This can be approached by using wp_dropdown_pages() with the child_of parameter. global $post; $args = array( 'child_of' => $post->ID ); wp_dropdown_pages( $args ); The variable name will be $_GET['post_id'] or $_POST['post_id'], depending on your form settings, you can change the name by altering the name parameter. The value of the ...


2

Probably the folder is there already. With your ftp client, browse to wp-content > plugins. Do you see it there? then delete it and try again. You can also download the plugin folder from the Wordpress plugin page to your computer and ftp it to the wp-content/plugins folder. This way it won't give any problems because, if you already have the folder there, ...


2

Try this instead. There was some internal restructuring in CF7 3.9. add_action('wpcf7_before_send_mail','send_pdf'); function send_pdf( $cf7 ) { $id = $cf7->id(); if ($id==741){ $submission = WPCF7_Submission::get_instance(); $submission->add_uploaded_file('pdf', get_template_directory().'/test.pdf'); } } This should ...


2

You know the id of the form from the shortcode, you can do stuff just for that particular form. Here's some sample code for that, just replace $myform_id with your form id: add_action( 'wpcf7_mail_sent', 'wp190913_wpcf7' ); /** * Do stuff for my contact form form. This function shouldn't return aything * * @param WPCF7_ContactForm $contact_form wpcf7 ...


2

-- Append parent_ to all your top level options' values like: parent_Course A, parent_Course B -- Also add extra options with the value as "endparent" something like below structure parent_Course A: course 1 course 2 course 3 course 4 endparent parent_Course B: course 1 course 2 course 3 endparent Code: // contact us form - change out ...


2

There is no RIGHT way to do this, instead there might be more efficient ways and or preferred ways to do this over another but even then, that does not make any of them more right than the other. I say this just to clear to air in case you and or others take any "selected" answer as being gospel because there are many ways to skin a cat achieve an ...


2

I found the solution myself, It had something to do with my code echoing out $content = $page->post_content ... echo $content;... I changed this to $content = apply_filters('the_content', $page->post_content); ... echo $content;... And now it works! Ref: ...


2

This is actual mail server trouble, where email cannot be sent. This link will useful. http://angstrey.com/index.php/2009/04/22/how-to-send-e-mail-with-wordpress-from-godaddy-windows-hosting/


2

What I normally do when using this combination of plugins is to create one form per language. Easy and effective. You could also try qTranslate quicktags: [:en]English text[:ru]Фамилия. But much probably this will lead to some issues down the road.


2

I just checked your site. There is a javascript error when you submit the form. It looks like the issue is caused by the plugin wp-super-heatmap. Disable that and try it again! If that is not it, start disabling one plugin at a time. I am certain that another plugin causes this issue, and I am pretty sure it is wp-super-heatmap!


2

Thanks to Michael Simpson, from Contact Form DB. The solution is listed (kind of hidden) on the Contact Form DB website in the article - CF7 Menus with Pipes Add to functions.php function myFilter($formData) { // Change $formData return $formData; // be sure to return it } add_filter('cfdb_form_data', 'myFilter'); function ...


2

You can use a tel shortcode to do this: [tel* id:field-mobile 10/10 "placeholder text"] This brings up the issue of browser support; if the browser in use does not support the tel input type, it will fall back to a plain text field. Source: http://contactform7.com/text-fields/ (halfway down the page)


2

Have you tried the options suggested in this WordPress Support thread? They range from copying the generated code in a Text Widget to parsing the shortcode yourself in your template (<?php echo do_shortcode('[contact-form 1 "Contact form 1"]'); ?>).


2

That action means "post the form back to the website root". Your website root is the very 'top level' of your domain, for example http://www.example.com/. The hash indicates the point in the document to jump to - in this case, I'm betting the ID of the form is wpcf7-f1-t1-o1? You shouldn't need to alter this. Even though the form is on a page outside of ...


2

You probably need to setup smtp for it to work. Your host probably has disabled the php mail function try this plugin http://wordpress.org/extend/plugins/wp-mail-smtp/



Only top voted, non community-wiki answers of a minimum length are eligible