insert_blog()

最后更新于:2021-11-27 06:57:11

insert_blog( string$domain, string$path, int$site_id)

Store basic site info in the blogs table.

参数

$domain

(string) (Required) The domain of the new site.

$path

(string) (Required) The path of the new site.

$site_id

(int) (Required) Unless you’re running a multi-network install, be sure to set this value to 1.

响应

(int|false) The ID of the new row

源文件

文件: gc-includes/ms-deprecated.php

function insert_blog($domain, $path, $site_id) {
	_deprecated_function( __FUNCTION__, '5.1.0', 'gc_insert_site()' );

	$data = array(
		'domain'  => $domain,
		'path'    => $path,
		'site_id' => $site_id,
	);

	$site_id = gc_insert_site( $data );
	if ( is_gc_error( $site_id ) ) {
		return false;
	}

	clean_blog_cache( $site_id );

	return $site_id;
}