Core Function
View Source on Trac ↗ wpmu_create_blog()
wpmu_create_blog(
mixed $domain,
mixed $path,
mixed $title,
mixed $user_id,
mixed $options = array(),
mixed $network_id = 1
) Creates a site.
Parameters 6 required
| Name / Type | Description |
|---|---|
| $domain string | The new site's domain. Required |
| $path string | The new site's path. Required |
| $title string | The new site's title. Required |
| $user_id int | The user ID of the new site's admin. Required |
| array | $options Optional. Array of key=>value pairs used to set initial site options. If valid status keys are included ('public', 'archived', 'mature', 'spam', 'deleted', or 'lang_id') the given site status(es) will be updated. Otherwise, keys and values will be used to set options for the new site. Default empty array. Required |
| int | $network_id Optional. Network ID. Only relevant on multi-network installations. Default 1. Required |
Return Value
((int)
| WP_Error) Returns WP_Error object on failure, the new site ID on success.
Function Information
Since Version
MU (3.0.0)
Source File
wp-includes/ms-functions.php
Advertisement