wphooks.info - pre_get_site_by_path

pre_get_site_by_path

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/ms-load.php:
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
	 *
	 * @since 3.9.0
	 *
	 * @param null|bool|WP_Site $site     Site 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 array             $paths    The paths to search for, based on $path and $segments.
	 */
	$pre = apply_filters( 'pre_get_site_by_path', null, $domain, $path, $segments, $paths );
	if ( null !== $pre ) {
		if ( false !== $pre && ! $pre instanceof WP_Site ) {
			$pre = new WP_Site( $pre );
		}
		return $pre;
	}

	/*
	 * @todo