确认新站点注册。
原型
confirm_another_blog_signup( string $domain, string $path, string $blog_title, string $user_name, string $user_email = '', array $meta = array(), int $blog_id )
参数
$domain
(string)
(Required)
域名网址。
$path
(string)
(Required)
站点根路径。
$blog_title
(string)
(Required)
网站标题。
$user_name
(string)
(Required)
用户名。
$user_email
(string)
(Optional)
用户的电子邮件地址。
$meta
(array)
(Optional)
来自validate_blog_signup()中’add_signup_meta’过滤器的任何其他元数据。
$blog_id
(int)
(Required)
网站ID。
源文件
路径:wp-signup.php
<?php
...
function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array(), $blog_id = 0 ) {
if ( $blog_id ) {
switch_to_blog( $blog_id );
$home_url = home_url( '/' );
$login_url = wp_login_url();
restore_current_blog();
} else {
$home_url = 'http://' . $domain . $path;
$login_url = 'http://' . $domain . $path . 'wp-login.php';
}
$site = sprintf( '<a href="%1$s">%2$s</a>',
esc_url( $home_url ),
$blog_title
);
?>
<h2><?php
/* translators: %s: site name */
printf( __( 'The site %s is yours.' ), $site );
?></h2>
<p>
<?php printf(
/* translators: 1: link to new site, 2: login URL, 3: username */
__( '%1$s is your new site. <a href="%2$s">Log in</a> as “%3$s” using your existing password.' ),
sprintf(
'<a href="%s">%s</a>',
esc_url( $home_url ),
untrailingslashit( $domain . $path )
),
esc_url( $login_url ),
$user_name
); ?>
</p>
<?php
/**
* Fires when the site or user sign-up process is complete.
*
* @since 3.0.0
*/
do_action( 'signup_finished' );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/confirm_another_blog_signup/