Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: ms_network_not_found

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

This hook occurs 2 times in this file.

Line Code
333                 *
334                 * At the time of this action, the only recourse is to redirect somewhere
335                 * and exit. If you want to declare a particular network, do so earlier.
336                 *
337                 * @since 4.4.0
338                 *
339                 * @param string $domain       The domain used to search for a network.
340                 * @param string $path         The path used to search for a path.
341                 */
342                do_action( 'ms_network_not_found', $domain, $path );
343
344                return false;
345           } elseif ( $path === $current_site->path ) {
346                $current_blog = get_site_by_path( $domain, $path );
347           } else {
348                // Search the network path + one more path segment (on top of the network path).
349                $current_blog = get_site_by_path( $domain, $path, substr_count( $current_site->path, '/' ) );
350           }
351      } else {
 
Line Code
361
362      // The network declared by the site trumps any constants.
363      if ( $current_blog && $current_blog->site_id != $current_site->id ) {
364           $current_site = WP_Network::get_instance( $current_blog->site_id );
365      }
366
367      // No network has been found, bail.
368      if ( empty( $current_site ) ) {
369           /** This action is documented in wp-includes/ms-settings.php */
370           do_action( 'ms_network_not_found', $domain, $path );
371
372           return false;
373      }
374
375      // During activation of a new subdomain, the requested site does not yet exist.
376      if ( empty( $current_blog ) && wp_installing() ) {
377           $current_blog = new stdClass;
378           $current_blog->blog_id = $blog_id = 1;
379           $current_blog->public = 1;