insert_blog
函数
insert_blog ( $domain, $path, $site_id )
- 参数
-
-
(string)
$domain
The domain of the new site.- Required: 是
-
(string)
$path
The path of the new site.- Required: 是
-
(int)
$site_id
Unless you’re running a multi-network install, be sure to set this value to 1.- Required: 是
-
(string)
- 返回值
-
- (int|false) The ID of the new row
- 相关
-
- wp_insert_site()
- 定义位置
-
-
wp-includes/ms-deprecated.php
, line 570
-
wp-includes/ms-deprecated.php
- 引入
- –
- 弃用
- 5.1.0
Store basic site info in the blogs table.
This function creates a row in the wp_blogs table and returns
the new blog’s ID. It is the first step in creating a new blog.
function insert_blog($domain, $path, $site_id) { _deprecated_function( __FUNCTION__, '5.1.0', 'wp_insert_site()' ); $data = array( 'domain' => $domain, 'path' => $path, 'site_id' => $site_id, ); $site_id = wp_insert_site( $data ); if ( is_wp_error( $site_id ) ) { return false; } clean_blog_cache( $site_id ); return $site_id; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。