WP_Network::get_by_path

SummerySummery

Retrieve the closest matching network for a domain and path.

Syntax

WP_Network::get_by_path( string $domain = '', string $path = '', int|null $segments = null )

DescriptionDescription

This will not necessarily return an exact match for a domain and path. Instead, it breaks the domain and path into pieces that are then used to match the closest possibility from a query.

The intent of this method is to match a network during bootstrap for a requested site address.

ParametersParameters

$domain

(string) (Optional) Domain to check.

Default value: ''

$path

(string) (Optional) Path to check.

Default value: ''

$segments

(int|null) (Optional) Path segments to use. Defaults to null, or the full path.

Default value: null

ReturnReturn

(WP_Network|bool) Network object if successful. False when no network is found.

SourceSource

File: wp-includes/class-wp-network.php


			

ChangelogChangelog

Changelog
Version Description
4.4.0 Introduced.
Scroll to Top