show_blog_form() – Generates and displays the Sign-up and Create Site forms.

You appear to be a bot. Output may be restricted

Description

Generates and displays the Sign-up and Create Site forms.

Usage

show_blog_form( $blogname, $blog_title, $errors );

Parameters

$blogname
( string ) optional – The new site name.
$blog_title
( string ) optional – The new site title.
$errors
( WP_Error|string ) optional – A WP_Error object containing existing errors. Defaults to empty string.

Returns

void

Source

File name: wordpress/wp-signup.php


Lines:

1 to 100 of 127
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>';
  }

  $errmsg = $errors->get_error_message( 'blogname' );
  if ( $errmsg ) {
    ?>
		<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" autocomplete="off" /><br />';
  } else {
    $site_domain = preg_replace( '|^www\.|', '', $current_network->domain );
    echo '<input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" /><span class="suffix_address">.' . esc_html( $site_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;
    }

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

  // Site Title.
  ?>
	<label for="blog_title"><?php _e( 'Site Title:' ); ?></label>
	<?php
  $errmsg = $errors->get_error_message( 'blog_title' );
  if ( $errmsg ) {
    ?>
		<p class="error"><?php echo $errmsg; ?></p>
		<?php
  }
  echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" autocomplete="off" />';
  ?>

	<?php
  // Site Language.
  $languages = signup_get_available_languages();

  if ( ! empty( $languages ) ) :
    ?>
		<p>
			<label for="site-language"><?php _e( 'Site Language:' ); ?></label>
			<?php
      // Network default.
      $lang = get_site_option( 'WPLANG' );

      if ( isset( $_POST['WPLANG'] ) ) {
        $lang = $_POST['WPLANG'];
      }

      // Use US English if the default isn't available.
      if ( ! in_array( $lang, $languages, true ) ) {
        $lang = '';
      }

      wp_dropdown_languages(
        array(
          'name'                        => 'WPLANG',
          'id'                          => 'site-language',
          'selected'                    => $lang,
          'languages'                   => $languages,
          'show_available_translations' => false,
        )
      );
      ?>
		</p>
		<?php
    endif; // Languages.

    $blog_public_on_checked  = '';
    $blog_public_off_checked = '';
  if ( isset( $_POST['blog_public'] ) && '0' === $_POST['blog_public'] ) {
    $blog_public_off_checked = 'checked="checked"';
  } else {
    $blog_public_on_checked = 'checked="checked"';
  }
  ?>

	<div id="privacy">
		<p class="privacy-intro">

 View on GitHub View on Trac