insert_blog

DeprecatedDeprecated

This function has been deprecated. Use wp_insert_site() instead.

SummerySummery

Store basic site info in the blogs table.

Syntax

insert_blog( string $domain, string $path, int $site_id )

DescriptionDescription

This function creates a row in the wp_blogs table and returns the new blog’s ID. It is the first step in creating a new blog.

ParametersParameters

$domain

(string) (Required) The domain of the new site.

$path

(string) (Required) The path of the new site.

$site_id

(int) (Required) Unless you're running a multi-network install, be sure to set this value to 1.

ReturnReturn

(int|false) The ID of the new row

SourceSource

File: wp-includes/ms-deprecated.php


			

ChangelogChangelog

Changelog
Version Description
5.1.0 Use wp_insert_site()
MU (3.0.0) Introduced.

See alsoSee also

Scroll to Top