confirm_another_blog_signup()

最后更新于:2021-11-25 21:32:49

confirm_another_blog_signup( string$domain, string$path, string$blog_title, string$user_name, string$user_email=”, array$meta=array(), int$blog_id)

Confirm a new site signup.

参数

$domain

(string) (Required) The domain URL.

$path

(string) (Required) The site root path.

$blog_title

(string) (Required) The site title.

$user_name

(string) (Required) The username.

$user_email

(string) (Optional) The user’s email address.

Default value: ”

$meta

(array) (Optional) Any additional meta from the ‘add_signup_meta’ filter in validate_blog_signup().

Default value: array()

$blog_id

(int) (Required) The site ID.

源文件

文件: gc-signup.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 = gc_login_url();
		restore_current_blog();
	} else {
		$home_url  = 'http://' . $domain . $path;
		$login_url = 'http://' . $domain . $path . 'gc-login.php';
	}

	$site = sprintf(
		'<a href="https://docs.gechiui.com/functions/confirm_another_blog_signup/%1$s">%2$s</a>',
		esc_url( $home_url ),
		$blog_title
	);

	?>
	<h2>
	<?php
		/* translators: %s: Site title. */
		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="https://docs.gechiui.com/functions/confirm_another_blog_signup/%2$s">Log in</a> as &#8220;%3$s&#8221; using your existing password.' ),
			sprintf(
				'<a href="https://docs.gechiui.com/functions/confirm_another_blog_signup/%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' );
}