Description

The wpforms_mailcheck_toplevel_domains 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/src/Frontend/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 );


A top-level domain (TLD) is the last segment of text in a domain name, such as .com or .net.

Reference Articles

How to Add Domains to the Email Suggestion List