Un motore di ricerca WordPress per sviluppatori e autori di temi



show_blog_form ›

Da3.0.0
Deprecaton/a
show_blog_form ( $blogname = '', $blog_title = '', $errors = '' )
Parametri: (3)
  • (string) $blogname The new site name.
    Richiesto: No
    Default: (vuoto)
  • (string) $blog_title The new site title.
    Richiesto: No
    Default: (vuoto)
  • (WP_Error|string) $errors A WP_Error object containing existing errors. Defaults to empty string.
    Richiesto: No
    Default: (vuoto)
Definito a:
Codex:
ChangeLog:
  • MU

Generates and displays the Signup and Create Site forms



Sorgenti

function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
	if ( ! is_wp_error( $errors ) ) {
		$errors = new WP_Error();
	}

	$current_network = get_network();
	// Blog name
	if ( ! is_subdomain_install() ) {
		echo '<label for="blogname">' . __( 'Site Name:' ) . '</label>';
	} else {
		echo '<label for="blogname">' . __( 'Site Domain:' ) . '</label>';
	}

	if ( $errmsg = $errors->get_error_message( 'blogname' ) ) {
		?>
		<p class="error"><?php echo $errmsg; ?></p>
		<?php
	}

	if ( ! is_subdomain_install() ) {
		echo '<span class="prefix_address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" /><br />';
	} else {
		echo '<input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" /><span class="suffix_address">.' . ( $site_domain = preg_replace( '|^www\.|', '', $current_network->domain ) ) . '</span><br />';
	}

	if ( ! is_user_logged_in() ) {
		if ( ! is_subdomain_install() ) {
			$site = $current_network->domain . $current_network->path . __( 'sitename' );
		} else {
			$site = __( 'domain' ) . '.' . $site_domain . $current_network->path;
		}

		/* translators: %s: site address */
		echo '<p>(<strong>' . sprintf( __( 'Your address will be %s.' ), $site ) . '</strong>) ' . __( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) . '</p>';
	}

	// Blog Title
	?>
	<label for="blog_title"><?php _e( 'Site Title:' ); ?></label>
	<?php if ( $errmsg = $errors->get_error_message( 'blog_title' ) ) { ?>
		<p class="error"><?php echo $errmsg; ?></p>
		<?php
}