ms_network_not_found
Action HookDescription
Fires when a network cannot be found based on the requested domain and path. At the time of this action, the only recourse is to redirect somewhere and exit. If you want to declare a particular network, do so earlier.Hook Information
File Location |
wp-includes/ms-load.php
View on GitHub
|
Hook Type | Action |
Line Number | 387 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$domain
|
The domain used to search for a network. |
string
|
$path
|
The path used to search for a path. |
Usage Examples
Basic Usage
<?php
// Hook into ms_network_not_found
add_action('ms_network_not_found', 'my_custom_function', 10, 2);
function my_custom_function($domain, $path) {
// Your custom code here
}
Source Code Context
wp-includes/ms-load.php:387
- How this hook is used in WordPress core
<?php
382 }
383
384 // No network has been found, bail.
385 if ( empty( $current_site ) ) {
386 /** This action is documented in wp-includes/ms-settings.php */
387 do_action( 'ms_network_not_found', $domain, $path );
388
389 return false;
390 }
391
392 // During activation of a new subdomain, the requested site does not yet exist.
PHP Documentation
<?php
/**
* Fires when a network cannot be found based on the requested domain and path.
*
* At the time of this action, the only recourse is to redirect somewhere
* and exit. If you want to declare a particular network, do so earlier.
*
* @since 4.4.0
*
* @param string $domain The domain used to search for a network.
* @param string $path The path used to search for a path.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/ms-load.php
Related Hooks
Related hooks will be displayed here in future updates.