Filter hook 'domain_exists'

in WP Core File wp-includes/ms-functions.php at line 1617

View Source

domain_exists

Filter Hook
Description
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.

Hook Information

File Location wp-includes/ms-functions.php View on GitHub
Hook Type Filter
Line Number 1617

Hook Parameters

Type Name Description
int|null $result The site ID if the site name exists, null otherwise.
string $domain Domain to be checked.
string $path Path to be checked.
int $network_id Network ID. Only relevant on multi-network installations.

Usage Examples

Basic Usage
<?php
// Hook into domain_exists
add_filter('domain_exists', 'my_custom_filter', 10, 4);

function my_custom_filter($result, $domain, $path, $network_id) {
    // Your custom filtering logic here
    return $result;
}

Source Code Context

wp-includes/ms-functions.php:1617 - How this hook is used in WordPress core
<?php
1612  	 * @param int|null $result     The site ID if the site name exists, null otherwise.
1613  	 * @param string   $domain     Domain to be checked.
1614  	 * @param string   $path       Path to be checked.
1615  	 * @param int      $network_id Network ID. Only relevant on multi-network installations.
1616  	 */
1617  	return apply_filters( 'domain_exists', $result, $domain, $path, $network_id );
1618  }
1619  
1620  /**
1621   * Notifies the site administrator that their site activation was successful.
1622   *

PHP Documentation

<?php
/**
	 * 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.
	 *
	 * @since 3.5.0
	 *
	 * @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.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 4
  • File: wp-includes/ms-functions.php
Related Hooks

Related hooks will be displayed here in future updates.