WordPress.org

Codex

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

WPMU Functions/create empty blog

Description

Checks to see if the blog already exists, and if not it then inserts the blog into the database using insert_blog.

Parameters

$domain
(string) (required) The domain of the new blog.
Default: None
$path
(string) (required) The path of the new blog.
Default: None
$weblog_title
(string) (required) The title of the new blog.
Default: None
$site_id
(integer) (optional) The site id of the new blog.
Default: 1

Return Values

(integer) 
Returns the id of the newly created blog on success.
(string) 
When the blog already exists, with error message "error: Blog URL already taken.".

Usage

For domain-based blogs, $domain should contain the entire domain of the new blog. $domain = 'myblog.wordpress.com';

For path-based blogs, $path should contain the path to the new blog. For domain-based blogs this value should be "/". $path = '/'; // for domain-based blogs $path = 'myblog'; // for path-based blog

<?php create_empty_blog($domain$path$weblog_title$site_id); ?>

Resources