get_network_by_path( string $domain, string $path, int|null $segments = null ): WP_Network|false

In this article

Retrieves the closest matching network for a domain and path.

Parameters

$domainstringrequired
Domain to check.
$pathstringrequired
Path to check.
$segmentsint|nulloptional
Path segments to use. Defaults to null, or the full path.

Default:null

Return

WP_Network|false Network object if successful. False when no network is found.

Source

function get_network_by_path( $domain, $path, $segments = null ) {
	return WP_Network::get_by_path( $domain, $path, $segments );
}

Changelog

VersionDescription
3.9.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.