Contact Form 7 Modules

Contact Form 7 Modules

توسط

Add Hidden Fields to Contact Form 7

The Contact Form 7 plugin has over 1 million active installations, yet the great plugin still lacks a simple feature: hidden fields. This plugin adds hidden fields to Contact Form 7 once and for all.

Inserting dynamic values

You can also choose to have the value of the hidden field dynamically populated in your form when you are contacted. To do so, choose the “Default value” to be:

  • post_title – Inserts the title of the post/page
  • post_category – The categories of the post or page
  • post_url – The URL of the post or page
  • post_author – The author of the post or page
  • custom_field-[Name] – The value of a post or page’s custom field. If you had a custom field “Foo”, you would use the following as the hidden field value: custom_field-Foo

The following values will be replaced if an user is logged in:

  • user_name: User Login
  • user_id: User ID
  • user_email: User Email Address
  • user_display_name: Display Name (Generally the first and last name of the user)
  • user_url: User Website

And you can also use it for user custom meta data using the format of user-{field}:

  • user-aim: AIM
  • user-jabber: Jabber / Google Talk
  • user-description: User Bio

You can also use a filter: hook into the wpcf7_hidden_field_value filter to modify the value of the hidden field using add_filter(). If you know the ID of the input, you can also use the wpcf7_hidden_field_value_[#ID] filter.

Now, when someone contacts you using your Contact Form 7 contact form, you can have lots more information about their visit – and you’ll see it when you receive the email that tells you you’ve been contacted.

Easily Send All Submitted Fields At Once

Save time setting up your form emails…and never miss a field!

One of the limitations of Contact Form 7 is that you need to manually add each field to generated emails. This means that if you update the form with a new field and forget to add it to your email message, you won’t receive it in your email. No longer..

Using the Send All Fields module, you simply need to add [all-fields] to your message, and you will receive every field submitted. If you use HTML formatting, the formatting even looks nice.

Visit the official Contact Form 7 Modules plugin page for more support & additional information

  1. Upload plugin files to your plugins folder, or install using WordPress’ built-in Add New Plugin installer
  2. Activate the plugin
  3. Edit a form in Contact Form 7
  4. Choose “Hidden field” from the Generate Tag dropdown
  5. Follow the instructions on the page

سوالات متداول

Installation Instructions

  1. Upload plugin files to your plugins folder, or install using WordPress’ built-in Add New Plugin installer
  2. Activate the plugin
  3. Edit a form in Contact Form 7
  4. Choose “Hidden field” from the Generate Tag dropdown
  5. Follow the instructions on the page

How do I turn off formatting the key in the `[all-fields]` output?

Add the following to your theme’s functions.php file:

add_filter('wpcf7_send_all_fields_format_key', '__return_false');

How do I set non-standard user data as hidden field values?

Starting with Version 1.4, you can access user data, including meta data.

You need to set the default value as: user-{meta_key} where {meta_key} is the key of the meta field you want the value of.

To get the values of WordPress default profile fields, for example, you would use:

  • user-aim – AOL
  • user-jabber – Jabber / Google Talk
  • user-description – Biographical description

What is the plugin license?

  • This plugin is released under a GPL license.

How do I send empty values with the `[all-fields]` shortcode?

Add this to your functions.php file: add_filter('wpcf7_send_all_fields_send_empty_fields', '__return_true');

How do I modify the output of the `[all-fields]` shortcode?

  • wpcf7_send_all_fields_format_before – Before the loop of fields (<dl> for HTML output)
    • $value string Previous output
    • $format string Either “html” or “text”
  • wpcf7_send_all_fields_format_item – Change each item output. Passes four arguments:
    • $value string Previous output
    • $k string Field label
    • $v string Value of the field
    • $format string Either “html” or “text”
  • wpcf7_send_all_fields_format_after – After the loop of fields (</dl> for HTML output). Passes two arguments:
    • $value string Previous output
    • $format string Either “html” or “text”
×
نظری برای این آیتم موجود نیست.
0 0 رای ها
امتیازدهی
اشتراک در
اطلاع از
0 نظرات
قدیمی‌ترین
تازه‌ترین بیشترین رأی
نسخه حجم فایل SHA256 تغییرات دانلود
2.0.2 255 کیلوبایت -
دانلود
×
★★★★★
★★★★★
3.7 /5 (22 نظر)

قیمت:

رایگان

نگارش

2.0.2

آخرین انتشار

11 اردیبهشت 1405

آخرین بروزرسانی

4 ماه پیش

نصب های فعال

5,000+

نگارش وردپرس

وردپرس 2.8+

تست شده از نسخه

وردپرس 4.7.33

نگارش PHP

-

نسخه ها

1 نسخه