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
99                 *
100                 * At the time of this action, the only recourse is to redirect somewhere
101                 * and exit. If you want to declare a particular network, do so earlier.
102                 *
103                 * @since 4.4.0
104                 *
105                 * @param string $domain       The domain used to search for a network.
106                 * @param string $path         The path used to search for a path.
107                 */
108                do_action( 'ms_network_not_found', $domain, $path );
109
110                ms_not_installed( $domain, $path );
111           } elseif ( $path === $current_site->path ) {
112                $current_blog = get_site_by_path( $domain, $path );
113           } else {
114                // Search the network path + one more path segment (on top of the network path).
115                $current_blog = get_site_by_path( $domain, $path, substr_count( $current_site->path, '/' ) );
116           }
117      } else {
 
Line Code
127
128      // The network declared by the site trumps any constants.
129      if ( $current_blog && $current_blog->site_id != $current_site->id ) {
130           $current_site = WP_Network::get_instance( $current_blog->site_id );
131      }
132
133      // No network has been found, bail.
134      if ( empty( $current_site ) ) {
135           /** This action is documented in wp-includes/ms-settings.php */
136           do_action( 'ms_network_not_found', $domain, $path );
137
138           ms_not_installed( $domain, $path );
139      }
140
141      // During activation of a new subdomain, the requested site does not yet exist.
142      if ( empty( $current_blog ) && wp_installing() ) {
143           $current_blog = new stdClass;
144           $current_blog->blog_id = $blog_id = 1;
145           $current_blog->public = 1;