Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/insert blog

This page redirects to an external site: https://developer.wordpress.org/reference/functions/insert_blog/

Description

Store basic site info in the blogs table.

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.

Usage

<code style="color: #000000"><span style="color: #0000BB"><?php insert_blog</span><span style="color: #007700">( </span><span style="color: #0000BB">$domain</span><span style="color: #007700">, </span><span style="color: #0000BB">$path</span><span style="color: #007700">, </span><span style="color: #0000BB">$site_id </span><span style="color: #007700">); </span><span style="color: #0000BB">?></span></code>

Parameters

$domain
(string) (required) The domain of the new site.
Default: None
$path
(string) (required) The path of the new site.
Default: None
$site_id
(int) (required) Unless you're running a multi-network install, be sure to set this value to 1.
Default: None

Return Values

(int) 
The ID of the new row

Change Log

Since: MU

Source File

insert_blog() is located in wp-includes/ms-functions.php