Contact Form 7 4.6

Contact Form 7 4.6 is available. This release has been confirmed as compatible with the upcoming WordPress 4.7, and includes a lot of new features and improvements I’m sure you have been looking for.


Compatible with WordPress 4.7

WordPress 4.7 is scheduled to be released within the next few days. Among several highlights of 4.7, I think the most attractive is the user admin languages — users can choose the language they prefer for their admin screen.

This means that creating localized contact forms has become easier than ever; you don’t even need a multilingual plugin. Simply choose your admin language in your profile page, and then create a new contact form.

Translations are supplied from translate.wordpress.org. You can update translations in Dashboard > Updates on the admin menu.

Update of Ajax Loader: Easily Customizable with CSS

In previous versions, Ajax loader (the spinning arrow icon that shows up when you press the submit button) was marked up as an <img> element and was a bit difficult to customize.

In 4.6, Ajax loader has become a <span> element and is easier to customize with CSS. You can use modern techniques like icon fonts, SVG, CSS animation or emojis to customize it. Feel free to be creative!

HTML Mail: Customizable Header and Footer

HTML mail has become more compliant with the specification. Contact Form 7 appends a proper header and footer to HTML mail content automatically. Also, two filters (wpcf7_mail_html_header and wpcf7_mail_html_footer) have been introduced to customize them.

Serial Number Mail-Tag

A special mail-tag [_serial_number] has been added. If you use this tag in your mail content, it will be replaced by a numeric string whose value increments. You can use it as the serial number of a message.

This feature requires that Flamingo 1.5+ be installed.

Hidden Field Form-Tag and Its Option to Get Value from Shortcode Attribute

The hidden input field module has finally been introduced. Hidden fields are not visible on the front end.

Hidden field form-tag would be useful in combination with the default:shortcode_attr option. For example, if you specify the option in a hidden field like this:

[hidden destination-email default:shortcode_attr]

and you have a contact-form-7 shortcode like this:

[contact-form-7 id="123" title="Contact Form" destination-email="xxxxxx@example.com"]

the destination-email hidden field will have a value of xxxxxx@example.com.

Note that you need to register the shortcode attribute you use beforehand. For details, refer to the documentation for default:shortcode_attr.

WPCF7_Shortcode Has Become Deprecated

WPCF7_Shortcode class is now marked as deprecated. If you use WPCF7_Shortcode in your custom code, you will need to replace it with WPCF7_FormTag. Otherwise, you will receive a warning if you are in the debug mode.

I renamed this because the use of the term “shortcode” was confusing. It is actually a form-tag of the Contact Form 7 plugin, but sounds like a shortcode of WordPress itself. Those two concepts are similar, but fundamentally different.

For the same reason, some other classes, methods and functions have also become deprecated.

Deprecated Alternative
WPCF7_Shortcode WPCF7_FormTag
WPCF7_ShortcodeManager WPCF7_FormTagsManager
wpcf7_add_shortcode() wpcf7_add_form_tag()
wpcf7_scan_shortcode() wpcf7_scan_form_tags()

Requires: WordPress 4.5 or higher
Tested up to: WordPress 4.7

» Download Contact Form 7 plugin from WordPress.org

Change Log

  • Ajax loader: HTML markup changed to <span> to be easily customizable with CSS.
  • Appends a proper header and footer to HTML mail content automatically.
  • [_serial_number] special mail-tag.
  • New form-tag type for hidden fields.
  • default:shortcode_attr form-tag option.
  • WPCF7_Shortcode, WPCF7_ShortcodeManager, wpcf7_add_shortcode(), wpcf7_scan_shortcode(), and some other classes and functions have become deprecated.
  • Removed all language files from the languages folder. Translations have moved to translate.wordpress.org.