Hot answers tagged

12

Revisited and updated answer: We can't use the user_contactmethods filter to remove the website wrapper, because this piece is hardcoded in the user-edit.php file and not part of the filterable user contacts loop, generated by: wp_get_user_contact_methods( $profileuser ) Hiding it with CSS The website row element now got it's own .user-url-wrap class: ...


8

No need to write any code, Contact form 7 has features of Additional Headers in the Mail section. In that you just need to write the email's header inside the Additional headers textbox in Mail(Second Tab) section. Put this inside the Additional Headers textbox. Cc: [friend1-email], [friend2-email], [friend3-email], [friend4-email], [friend5-email] OR ...


5

I resolved the problem with ob_ functions and DOMDocument. It's better than jQuery or CSS for protecting the form. I use this kind of solution every time when I can't access a part of HTML content through a hook. function remove_extra_field_profile() { $current_file_url = preg_replace( "#\?.*#" , "" , basename( $_SERVER['REQUEST_URI'] ) ); if( $...


5

I had the same exact problem. I had a successful plugin installation and successful test email, but Wordpress was still attempting to send mail via /usr/bin/sendmail. I confirmed this by checking my logs (/opt/bitnami/apache2/logs/error_log). To finally get up and running, I simply installed sendmail with the following commands: $ sudo apt-get update $...


3

Do not call your PHP files directly. This will break, because in some setups, the plugin directory might be located on another domain, and your file would operate without the WordPress context now. Use the current URL as form action URL (or admin-post.php), then test if the request is a POST request and handle the form submission. Then redirect back to the ...


3

See this example on how to create and parse the shortcode in the contact form 7 to use it add [current_url] add_action( 'wpcf7_init', 'wpcf7_add_form_tag_current_url' ); function wpcf7_add_form_tag_current_url() { // Add shortcode for the form [current_url] wpcf7_add_form_tag( 'current_url', 'wpcf7_current_url_form_tag_handler', ...


3

You can use cf7 hidden field shortcodes + get parameters: https://contactform7.com/hidden-field/ https://contactform7.com/getting-default-values-from-the-context/ In the mail form I use such shortcodes to get these slugs [hidden utm_source default:get] [hidden utm_medium default:get] [hidden utm_campaign default:get] [hidden utm_content default:get] [...


2

You should be able to paste the HTML of the Google Docs iframe directly into the page by using the TEXT mode of the edit form (instead of the VISUAL) mode. That mode allows you to enter the HTML directly, while the WYSIWYG editor will either ignore it or treat it as text.


2

Disable all other plugins. Use the default theme. Try again. If it doesn't send, try sending to a different (eg gmail) address. If that still doesn't work, verify that sendmail is installed. If it is, check and see if a basic sendmail php script will work. If that still doesn't work or sendmail isn't installed, you may need to contact your host regarding the ...


2

Ive done this before using both contact form 7 and Grunion Contact Form plugins, when using contact form 7 i created a new tag to send the email to the post author: //contact form 7 author email wpcf7_add_shortcode('author_email', 'wpcf7_expert_email_shortcode_handler', true); function wpcf7_expert_email_shortcode_handler($tag) { if (!is_array($tag)) ...


2

I agree with Eric, although I think postfix is even easier and won't require the symlink: $ sudo apt-get update $ sudo apt-get install postfix You'll be walked through configuration options for postfix then, but on every RedHat, Debian, Ubuntu, or Amazon Linux AMI I've used in the past couple of years, the OOTB setup of Postfix works just fine.


2

Probably the theme is using a page template. When you create a Contact page, on the right side, look for "Template" and select the Contact page template from the drop down menu.


2

<?php the_content(); ?> That's the function that displays everything you saved in Pages - > Contact Page. You just need to move that anywhere you would like. Just keep in mind the_content() must be between the while loop for it to work. <?php if (have_posts()) : while (have_posts()) : the_post(); ?> // Begins loop <?php endwhile; ?> // ...


2

If your form has been incorporated into WordPress as a page template, which I encourage, then get_permalink(8); // or 12 should do it. If not, then http://example.com/?p=8 and http://example.com/?p=12 should always work. http://example.com/?page_id=8 and http://example.com/?page_id=12 uses the proper parameter for pages but ?p= works fine when I test it.


2

Expanding on @birgire's and justifying @Patricia Walton's answer, if you only add add_action('admin_head-user-edit.php','remove_website_row_wpse_94963'); it will only be gone from the page where admin is editing a profile. To also make it disappear when a user edits its own profile add also add_action('admin_head-profile.php','...


2

Assuming there is no contact form plugin which matches your needs, the proper way to do it in wordpress is to write and add an appropriate page template to your theme which contains and handles your form. Once done you associate the page in which the form should be displayed with the page template and then your action path is simply "".


2

Here's a Step by Step Guide to adding Javascript into Pages: Step 1: Log into WordPress Step 2: Navigate to whichever page you want to add the scripts onto. Step 3a: If you have some kind of Page Builder you'll need to click the "Basic Editor" button or something similar so you get the Default WordPress Editor which looks like this: Step 3b: Once you ...


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

The quick and dirty way (but less dirty than page by page edits) would be a shortcode: function my_sharpspring() { $str = <<<EOD <!-- SharpSpring Form for General Contact Form --> <script type="text/javascript"> var ss_form = {'account': 'MzQ3NTM0MwQA', 'formID': 'S0syMjA2SjLTTUsyMNE1STU10rVMNUvRNUk0NjCwMDS0SDM2AAA'}; ss_form.width = '...


2

<?php // number 9 will be user ID $all_meta_for_user = get_user_meta( 9 ); print_r( $all_meta_for_user ); // find the key that you want Array ( [first_name] => Array ( [0] => Tom ) [last_name] => Array ( [0] => Auger) [nickname] => Array ( [0] => tomauger ) [description] => etc.... ) // store it in a ...


2

If you are not looping all users and only want to get current user phone_number meta then you can try the below. $current_user_id = get_current_user_id(); $phone = get_user_meta($current_user_id,'phone_number',true); echo $phone; NOTE: This will work only for logged in user. Also Check phone_number meta_key. By default wordpress doesn't have such meta ...


2

WordPress has a shortcut for getting the current user ID, which it sounds like you need-- get_current_user_id(). Using that you should be able to get the information you need. The following is a proof of concept block of code that will check for the return values of the functions and apply some conditional logic in case you need to: $uid = ...


2

Sending an email from an address you don't own will mean you run into problems with countermeasures again email spoofing (e.g SPF), as you're effectively impersonating the user's email address to send your email. You could put the user email address as the name, but send the email from an address you own For contact form 7 an example would be to put in the ...


2

This theme downloads 2 folders with name kyma and spina. so, go to kyma\functions\customize where you get contact-widgets.php and change contact information there.


2

You don't need Postfix if you use an SMTP plugin like, for example, WP Mail SMTP. Such kind of plugins can send email from your Google account via SMTP. I have just checked it by stopping postfix and successfully sending an email via WP Mail SMTP. If no SMTP plugins are activated on your site, you definitely need system transport, which can be Postfix or ...


2

the form submit already send the container post then you just need to retrive it in and put it in the e-mail. For that, try this code : add_filter("wpcf7_posted_data", function ($wpcf7_posted_data) { $post = get_post($wpcf7_posted_data["_wpcf7_container_post"]); $wpcf7_posted_data["containerURL"] = get_permalink($post); return $...


1

You are actually closer in your first attempt. My recommendation would be to create a folder called "scripts" in the WP root and put your PHP script files in here as well as your attachment(s). You will then need to declare the full path in your action attribute as the script does not now share the same file path as in your "flat HTML file structure". ...


1

Most probably it's because SPF misconfiguration. SPF allows the owner of an Internet domain to specify which computers are authorized to send mail with sender addresses in that domain, using Domain Name System (DNS) records. Receivers verifying the SPF information in TXT records may reject messages from unauthorized sources before receiving the body of ...


1

If you install Jetpack which is a product of Automattic/WordPress you will then have the form feature you mention in the link you provided. http://jetpack.me/support/contact-form/


1

Currently I'm assuming that is is backend (front end is slightly different), but it's very easy to implement on the frontend if required. You are correct in thinking that because you haven't used the WordPress admin-ajax.php file, all the goodness of WordPress is missing. Fortunately this is easily fixed. Before continuing I recommend that you take a look ...


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