Description

The filter fires as the Email Address field is completed to check for suggested email domains.

Parameters

$domains
(array) An array of top-level domains for the email suggestion.

Source

wpforms/includes/class-frontend.php

More Information

The wpforms_mailcheck_toplevel_domains filter can be used to define top level email domain suggestions for the Email Address form field.

Example

/**
 * Check for top-level email domain suggestions.
 *
 * @link    https://wpforms.com/developers/wpforms_mailcheck_toplevel_domains/
 *
 * @param   array  $domains An array of top-level domains for the email suggestion..
 * @return  array
 */

function wpf_dev_mailcheck_toplevel_domains( $domains ) {
 
    $domains[] = 'xyz';
 
    return $domains;
}
 
add_filter( 'wpforms_mailcheck_toplevel_domains', 'wpf_dev_mailcheck_toplevel_domains', 10, 1 );


Tutorial Reference: How to Add Domains to the Email Suggestion List