Description
The wpforms_disable_all_emails
filter is used to disable all form notification emails.
Parameters
- $disable
- (bool) (Required) If true, all notification emails will be disabled (default is
false
).
Source
wpforms/includes/emails/class-emails.php
More Information
The wpforms_disable_all_emails
filter applies to all notification emails within the form submission process. It can be used to prevent form notification emails from being sent site-wide, regardless of settings within the form builder.
Examples
Note: This filter will disable all email notifications for all forms and should be used with caution.
/** * Filter used to disable all form notification emails. * * @link https://wpforms.com/developers/wpforms_disable_all_emails/ * * @param bool $disable Default is false. If true, disables email notifications. * * @return bool */ function wpf_dev_disable_all_emails( $disable ) { // Disable ALL WPForms email notifications site wide $disable = true; return $disable; } add_filter( 'wpforms_disable_all_emails', 'wpf_dev_disable_all_emails', 10, 1 );