wpcf7_is_email_in_site_domain() CF7 1.0
Хуков нет.
Возвращает
Null. Ничего.
Использование
wpcf7_is_email_in_site_domain( $email );
- $email (обязательный)
- -
Код wpcf7_is_email_in_site_domain() wpcf7 is email in site domain CF7 5.4
function wpcf7_is_email_in_site_domain( $email ) {
if ( wpcf7_is_localhost() ) {
return true;
}
$site_domain = strtolower( $_SERVER['SERVER_NAME'] );
if ( preg_match( '/^[0-9.]+$/', $site_domain ) ) { // 123.456.789.012
return true;
}
if ( wpcf7_is_email_in_domain( $email, $site_domain ) ) {
return true;
}
$home_url = home_url();
// for interoperability with WordPress MU Domain Mapping plugin
if ( is_multisite()
and function_exists( 'domain_mapping_siteurl' ) ) {
$domain_mapping_siteurl = domain_mapping_siteurl( false );
if ( $domain_mapping_siteurl ) {
$home_url = $domain_mapping_siteurl;
}
}
if ( preg_match( '%^https?://([^/]+)%', $home_url, $matches ) ) {
$site_domain = strtolower( $matches[1] );
if ( $site_domain != strtolower( $_SERVER['SERVER_NAME'] )
and wpcf7_is_email_in_domain( $email, $site_domain ) ) {
return true;
}
}
return false;
}