记录站点注册信息以供将来激活。

原型

wpmu_signup_blog( string $domain, string $path, string $title, string $user, string $user_email, array $meta = array() )

参数

$domain (string) (Required) 请求的域名。

$path (string) (Required) 请求的路径。

$title (string) (Required) 请求的网站标题。

$user (string) (Required) 用户请求的登录名。

$user_email (string) (Required) 用户的电子邮件地址。

$meta (array) (Optional)  注册元数据。默认情况下,包含所请求的隐私设置和lang_id。

源文件

路径:wp-includes/ms-functions.php

<?php
...
function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() )  {
	global $wpdb;
	$key = substr( md5( time() . wp_rand() . $domain ), 0, 16 );
	/**
	 * Filters the metadata for a site signup.
	 *
	 * The metadata will be serialized prior to storing it in the database.
	 *
	 * @since 4.8.0
	 *
	 * @param array  $meta       Signup meta data. Default empty array.
	 * @param string $domain     The requested domain.
	 * @param string $path       The requested path.
	 * @param string $title      The requested site title.
	 * @param string $user       The user's requested login name.
	 * @param string $user_email The user's email address.
	 * @param string $key        The user's activation key.
	 */
	$meta = apply_filters( 'signup_site_meta', $meta, $domain, $path, $title, $user, $user_email, $key );
	$wpdb->insert( $wpdb->signups, array(
		'domain' => $domain,
		'path' => $path,
		'title' => $title,
		'user_login' => $user,
		'user_email' => $user_email,
		'registered' => current_time('mysql', true),
		'activation_key' => $key,
		'meta' => serialize( $meta )
	) );
	/**
	 * Fires after site signup information has been written to the database.
	 *
	 * @since 4.4.0
	 *
	 * @param string $domain     The requested domain.
	 * @param string $path       The requested path.
	 * @param string $title      The requested site title.
	 * @param string $user       The user's requested login name.
	 * @param string $user_email The user's email address.
	 * @param string $key        The user's activation key.
	 * @param array  $meta       Signup meta data. By default, contains the requested privacy setting and lang_id.
	 */
	do_action( 'after_signup_site', $domain, $path, $title, $user, $user_email, $key, $meta );
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wpmu_signup_blog/