domain_exists
Filters whether a site name is taken.
The name is the site's subdomain or the site's subdirectory path depending on the network settings.
Использование
add_filter( 'domain_exists', 'wp_kama_domain_exists_filter', 10, 4 );
/**
* Function for `domain_exists` filter-hook.
*
* @param int|null $result The site ID if the site name exists, null otherwise.
* @param string $domain Domain to be checked.
* @param string $path Path to be checked.
* @param int $network_id Network ID. Only relevant on multi-network installations.
*
* @return int|null
*/
function wp_kama_domain_exists_filter( $result, $domain, $path, $network_id ){
// filter...
return $result;
}
- $result(int|null)
- The site ID if the site name exists, null otherwise.
- $domain(строка)
- Domain to be checked.
- $path(строка)
- Path to be checked.
- $network_id(int)
- Network ID. Only relevant on multi-network installations.
Список изменений
| С версии 3.5.0 | Введена. |
Где вызывается хук
domain_exists
wp-includes/ms-functions.php 1617
return apply_filters( 'domain_exists', $result, $domain, $path, $network_id );