Description
Filter used to disable all form notification emails.
Parameters
- $disable
- (bool) (Required) If true, all notification emails will be disabled (default is
false
). - $this
- (object) (Required) Instance of the
WPForms_WP_Emails
class, which handles all notification emails sent by WPForms.
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. * @param object $this Instance of the WPForms_WP_Emails class * * @return bool */ function wpf_dev_disable_all_emails( $disable, $this ) { // disable ALL WPForms email notifications site wide $disable = true; return $disable; } add_filter( 'wpforms_disable_all_emails', 'wpf_dev_disable_all_emails', 10, 2 );