domain_exists

Filters whether a blogname is taken.

Description

apply_filters( 'domain_exists', (int|null) $result, (string) $domain, (string) $path, (int) $site_id ); 

Parameters (4)

0. $result (int|null)
The blog_id if the blogname exists, null otherwise.
1. $domain (string)
Domain to be checked.
2. $path (string)
Path to be checked.
3. $site_id (int)
Site ID. Relevant only on multi-network installs.

Usage

To run the hook, copy the example below.
  1. $result = apply_filters( 'domain_exists', $result, $domain, $path, $site_id ); 
  2.  
  3. if ( !empty( $result ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the domain_exists callback 
  2. function filter_domain_exists( $result, $domain, $path, $site_id ) { 
  3. // make filter magic happen here... 
  4. return $result
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'domain_exists', 'filter_domain_exists', 10, 4 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'domain_exists', 'filter_domain_exists', 10, 4 ); 

Defined (1)

The filter is defined in the following location(s).

/wp-includes/ms-functions.php  
  1. return apply_filters( 'domain_exists', $result, $domain, $path, $site_id );