wpmu_create_blog()创建一个新博客(多站点)

目录

描述

Creates a new blog (multisite).

This function runs when a user self-registers a new site as well as when a Super Admin creates a new site. Hook to 'wpmu_new_blog' for events that should affect all new sites.

On subdirectory installs, $domain is the same as the main site's domain, and the path is the subdirectory name (eg 'example.com' and '/blog1/'). On subdomain installs, $domain is the new subdomain + root domain (eg 'blog1.example.com'), and $path is '/'.

wpmu_create_blog() 描述

用法

<?php wpmu_create_blog$domain$path$title$user_id$meta$site_id ?>

wpmu_create_blog() 用法

参数

$domain

(string) (必填) Domain name for blog.

默认值: None

$path

(string) (必填) Path to the blog.

默认值: None

$title

(string) (必填) Title for blog.

默认值: None

$user_id

(int) (必填) ID of blog administrator.

默认值: None

$meta

(array) (可选) Array of blog meta (options).

默认值: empty string

$site_id

(int) (可选) Site ID, if running multiple networks.

默认值: 1

wpmu_create_blog() 参数

历史

添加于 版本: MU

wpmu_create_blog() 历史

源文件

wpmu_create_blog() 函数的代码位于 wp-includes/ms-functions.php

wpmu_create_blog() 源文件