wphooks.info - pre_get_network_by_path

pre_get_network_by_path

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/class-wp-network.php:
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
		 *
		 * @since 3.9.0
		 *
		 * @param null|bool|WP_Network $network  Network value to return by path.
		 * @param string               $domain   The requested domain.
		 * @param string               $path     The requested path, in full.
		 * @param int|null             $segments The suggested number of paths to consult.
		 *                                       Default null, meaning the entire path was to be consulted.
		 * @param string[]             $paths    Array of paths to search for, based on `$path` and `$segments`.
		 */
		$pre = apply_filters( 'pre_get_network_by_path', null, $domain, $path, $segments, $paths );
		if ( null !== $pre ) {
			return $pre;
		}

		if ( ! $using_paths ) {
			$networks = get_networks(
				array(
					'number'     => 1,
					'orderby'    => array(