get_blog_id_from_url

SummerySummery

Get a blog’s numeric ID from its URL.

Syntax

get_blog_id_from_url( string $domain, string $path = '/' )

DescriptionDescription

On a subdirectory installation like example.com/blog1/, $domain will be the root ‘example.com’ and $path the subdirectory ‘/blog1/’. With subdomains like blog1.example.com, $domain is ‘blog1.example.com’ and $path is ‘/’.

ParametersParameters

$domain

(string) (Required)

$path

(string) (Optional) Not required for subdomain installations.

Default value: '/'

ReturnReturn

(int) 0 if no blog found, otherwise the ID of the matching blog

SourceSource

File: wp-includes/ms-functions.php


			

ChangelogChangelog

Changelog
Version Description
MU (3.0.0) Introduced.
Scroll to Top