wp_initialize_site

SummerySummery

Runs the initialization routine for a given site.

Syntax

wp_initialize_site( int|WP_Site $site_id, array $args = array() )

DescriptionDescription

This process includes creating the site’s database tables and populating them with defaults.

ParametersParameters

$site_id

(int|WP_Site) (Required) Site ID or object.

$args

(array) (Optional) Arguments to modify the initialization behavior.

  • 'user_id'
    (int) Required. User ID for the site administrator.
  • 'title'
    (string) Site title. Default is 'Site %d' where %d is the site ID.
  • 'options'
    (array) Custom option $key => $value pairs to use.
  • 'meta'
    (array) Custom site metadata $key => $value pairs to use.

Default value: array()

ReturnReturn

(bool|WP_Error) True on success, or error object on failure.

SourceSource

File: wp-includes/ms-site.php


			

ChangelogChangelog

Changelog
Version Description
5.1.0 Introduced.
Scroll to Top