wp_install

SummerySummery

Installs the site.

Syntax

wp_install( string $blog_title, string $user_name, string $user_email, bool $public, string $deprecated = '', string $user_password = '', string $language = '' )

DescriptionDescription

Runs the required functions to set up and populate the database, including primary admin user and initial options.

ParametersParameters

$blog_title

(string) (Required) Site title.

$user_name

(string) (Required) User's username.

$user_email

(string) (Required) User's email.

$public

(bool) (Required) Whether site is public.

$deprecated

(string) (Optional) Not used.

Default value: ''

$user_password

(string) (Optional) User's chosen password. Default empty (random password).

Default value: ''

$language

(string) (Optional) Language chosen.

Default value: ''

ReturnReturn

(array) Data for the newly installed site.

  • 'url'
    (string) The URL of the site.
  • 'user_id'
    (int) The ID of the site owner.
  • 'password'
    (string) The password of the site owner, if their user account didn't already exist.
  • 'password_message'
    (string) The explanatory message regarding the password.

SourceSource

File: wp-admin/includes/upgrade.php


			

ChangelogChangelog

Changelog
Version Description
2.1.0 Introduced.
Scroll to Top