Contact Form 7 5.7

Contact Form 7 version 5.7 is now available. This is the second (and maybe last) major update in 2022.

As you can see in the Major changes section shown below, we packed (unusually) many improvements into this release. A lot of them are not eye-catching, but are necessary to make the plugin more reliable.

Our plans for next year include introduction of the block editor-based contact form editor. Contact Form 7 5.7 and minor updates that follow will pave a smooth road to the goal.

Reflection module

5.7 introduces a new form-tag type called reflection. A reflection form-tag reflects another form control’s value. For example, when you change the value of the your-name field to “John Doe”, [reflection your-name] will reflect that and display “John Doe”. This will be useful in cases such as when you want to let users confirm their input before submission.

Contact form selector block: improvements

The contact form selector block for the block-based post editor has been drastically improved in 5.7. Now you can search and select contact forms with the combo-box UI. You can also edit contact form properties (which were previously only customizable through the shortcode attributes) in the block sidebar.

SWV 1.1.0

The bundled Schema-Woven Validation (SWV) package has been updated to 1.1.0. This version of SWV additionally supports enum, minfilesize, maxitems, and minitems rule types.

Note about wpcf7_format_atts()

wpcf7_format_atts() is a helper function that formats HTML attributes. When we first introduced this function, we expected that it would only be used for form control elements, but it turned out to be useful for HTML elements of any kind. In 5.7, we have improved this function. Now it can properly handle all attribute types including boolean attributes.

If you are a developer and have used wpcf7_format_atts() in your code, you’re advised to double-check your code to see if you get the expected output.

Requires: WordPress 6.0 or higher
Tested up to: WordPress 6.1.1

» Download Contact Form 7 plugin from WordPress.org

Major changes

  • Introduces the reflection form-tag type.
  • Introduces WPCF7_PocketHolder to avoid use of dynamic (non-explicitly declared) properties.
  • Removes wpcf7_support_html5() calls.
  • Removes the wpcf7_form_novalidate filter hook.
  • Replaces esc_url_raw() calls with sanitize_url().
  • Adds autocomplete options to the form-tags in the default form template.
  • Removes the option to load scripts in the header.
  • Includes the block.json file for the contact form selector block.
  • Adds the js/no-js toggle class to the form root element.
  • Removes the role="form" attribute from the form root element.
  • Improves wpcf7_format_atts() and wpcf7_link().
  • Improves wpcf7_flat_join() to make the separator customizable.
  • Uses wp_get_list_item_separator() to allow the use of a localized separator string.
  • Introduces the WPCF7_HTMLFormatter class.
  • Overhauls wpcf7_autop() using WPCF7_HTMLFormatter.
  • Uses wpcf7_autop() for formatting HTML email.
  • Adds the aria-label attribute to the form element.
  • Introduces the html_title shortcode attribute and the wpcf7_form_title_attr filter hook.
  • Makes shortcode attributes editable in the block editor screen.
  • Introduces a combo-box in the contact form selector block.
  • Contact form selector block: Adds a link to the contact form editor page.
  • SWV: Updates to version 1.1.0 (Contact Form 7 SWV Schema 2022-10).
  • SWV: Supports the minfilesize rule type and the enum rule type.
  • SWV: Supports the maxitems and minitems rule types.
  • Updates the supported Stripe API version to 2022-08-01.
  • File uploading field: Supports the capture attribute.
  • Drop-down menu: Uses more friendly label text.
  • Updates Apache directives.
  • Adds Akismet to the Integration screen.
  • Akismet: Adds akismet:* options to the default form template.
  • Akismet: Adds a privacy notice to the default form template.
  • Introduces wpcf7_switch_locale() and wpcf7_unload_textdomain().

You can browse the full list of changes on GitHub.