Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: pre_get_network_by_path

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

Line Code
408            * @since 3.9.0
409            *
410            * @param null|bool|WP_Network $network  Network value to return by path.
411            * @param string               $domain   The requested domain.
412            * @param string               $path     The requested path, in full.
413            * @param int|null             $segments The suggested number of paths to consult.
414            *                                       Default null, meaning the entire path was to be consulted.
415            * @param string[]             $paths    Array of paths to search for, based on `$path` and `$segments`.
416            */
417           $pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths );
418           if ( null !== $pre ) {
419                return $pre;
420           }
421
422           if ( ! $using_paths ) {
423                $networks = get_networks(
424                     array(
425                          'number'     => 1,
426                          'orderby'    => array(