confirm_another_blog_signup

函式
confirm_another_blog_signup ( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array(), $blog_id = 0 )
引數
  • (string) $domain The domain URL.
    Required:
  • (string) $path The site root path.
    Required:
  • (string) $blog_title The site title.
    Required:
  • (string) $user_name The username.
    Required:
  • (string) $user_email The user's email address.
    Required:
    Default: (empty)
  • (array) $meta Any additional meta from the {@see 'add_signup_meta'} filter in validate_blog_signup().
    Required:
    Default: array()
  • (int) $blog_id The site ID.
    Required:
定義位置
相關方法
confirm_blog_signupvalidate_another_blog_signupconfirm_user_signupwpmu_validate_blog_signupvalidate_blog_signup
引入
-
棄用
-

confirm_another_blog_signup: 當使用者試圖在WordPress網路上註冊另一個部落格時,這個函式被呼叫。它顯示一個確認螢幕,提示使用者確認他們想註冊另一個部落格。

顯示一條確認新網站已被建立的資訊。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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 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="%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' );
}
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 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="%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' ); }
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 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="%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' );
}

常見問題

FAQs
檢視更多 >