Make WordPress Core

Changeset 44626


Ignore:
Timestamp:
01/16/2019 04:50:15 PM (5 years ago)
Author:
desrosj
Message:

Coding Standards: Manually fix coding standards violations in wp-signup.php.

Props GaryJ, jrf, netweb, desrosj.
Fixes #43405.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-signup.php

    r44574 r44626  
    104104
    105105    $current_network = get_network();
    106     // Blog name
     106    // Blog name.
    107107    if ( ! is_subdomain_install() ) {
    108108        echo '<label for="blogname">' . __( 'Site Name:' ) . '</label>';
     
    111111    }
    112112
    113     if ( $errmsg = $errors->get_error_message( 'blogname' ) ) {
     113    $errmsg = $errors->get_error_message( 'blogname' );
     114    if ( $errmsg ) {
    114115        ?>
    115116        <p class="error"><?php echo $errmsg; ?></p>
     
    120121        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 />';
    121122    } else {
    122         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 />';
     123        $site_domain = preg_replace( '|^www\.|', '', $current_network->domain );
     124        echo '<input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" /><span class="suffix_address">.' . esc_html( $site_domain ) . '</span><br />';
    123125    }
    124126
     
    137139    ?>
    138140    <label for="blog_title"><?php _e( 'Site Title:' ); ?></label>
    139     <?php if ( $errmsg = $errors->get_error_message( 'blog_title' ) ) { ?>
     141    <?php
     142    $errmsg = $errors->get_error_message( 'blog_title' );
     143    if ( $errmsg ) {
     144        ?>
    140145        <p class="error"><?php echo $errmsg; ?></p>
    141146        <?php
     
    179184        endif; // Languages.
    180185
    181         $blog_public_on_checked = $blog_public_off_checked = '';
     186        $blog_public_on_checked  = '';
     187        $blog_public_off_checked = '';
    182188    if ( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) {
    183189        $blog_public_off_checked = 'checked="checked"';
     
    246252    // User name
    247253    echo '<label for="user_name">' . __( 'Username:' ) . '</label>';
    248     if ( $errmsg = $errors->get_error_message( 'user_name' ) ) {
     254    $errmsg = $errors->get_error_message( 'user_name' );
     255    if ( $errmsg ) {
    249256        echo '<p class="error">' . $errmsg . '</p>';
    250257    }
     
    254261
    255262    <label for="user_email"><?php _e( 'Email&nbsp;Address:' ); ?></label>
    256     <?php if ( $errmsg = $errors->get_error_message( 'user_email' ) ) { ?>
     263    <?php
     264    $errmsg = $errors->get_error_message( 'user_email' );
     265    if ( $errmsg ) {
     266        ?>
    257267        <p class="error"><?php echo $errmsg; ?></p>
    258268    <?php } ?>
    259269    <input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" /><br /><?php _e( 'We send your registration email to this address. (Double-check your email address before continuing.)' ); ?>
    260270    <?php
    261     if ( $errmsg = $errors->get_error_message( 'generic' ) ) {
     271    $errmsg = $errors->get_error_message( 'generic' );
     272    if ( $errmsg ) {
    262273        echo '<p class="error">' . $errmsg . '</p>';
    263274    }
     
    333344    <p>
    334345        <?php
    335         /* translators: %s: Current user's display name. */
    336         printf( __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ), $current_user->display_name );
     346        printf(
     347            /* translators: %s: Current user's display name. */
     348            __( 'Welcome back, %s. By filling out the form below, you can <strong>add another site to your account</strong>. There is no limit to the number of sites you can have, so create to your heart&#8217;s content, but write responsibly!' ),
     349            $current_user->display_name
     350        );
    337351        ?>
    338352    </p>
     
    588602
    589603        <p>
    590         <?php if ( $active_signup == 'blog' ) { ?>
     604        <?php if ( 'blog' === $active_signup ) { ?>
    591605            <input id="signupblog" type="hidden" name="signup_for" value="blog" />
    592         <?php } elseif ( $active_signup == 'user' ) { ?>
     606        <?php } elseif ( 'user' === $active_signup ) { ?>
    593607            <input id="signupblog" type="hidden" name="signup_for" value="user" />
    594608        <?php } else { ?>
     
    913927
    914928$current_user = wp_get_current_user();
    915 if ( $active_signup == 'none' ) {
     929if ( 'none' === $active_signup ) {
    916930    _e( 'Registration has been disabled.' );
    917 } elseif ( $active_signup == 'blog' && ! is_user_logged_in() ) {
     931} elseif ( 'blog' === $active_signup && ! is_user_logged_in() ) {
    918932    $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) );
    919933    /* translators: %s: login URL */
     
    923937    switch ( $stage ) {
    924938        case 'validate-user-signup':
    925             if ( $active_signup == 'all' || $_POST['signup_for'] == 'blog' && $active_signup == 'blog' || $_POST['signup_for'] == 'user' && $active_signup == 'user' ) {
     939            if ( 'all' === $active_signup
     940                || ( 'blog' === $_POST['signup_for'] && 'blog' === $active_signup )
     941                || ( 'user' === $_POST['signup_for'] && 'user' === $active_signup )
     942            ) {
    926943                validate_user_signup();
    927944            } else {
     
    930947            break;
    931948        case 'validate-blog-signup':
    932             if ( $active_signup == 'all' || $active_signup == 'blog' ) {
     949            if ( 'all' === $active_signup || 'blog' === $active_signup ) {
    933950                validate_blog_signup();
    934951            } else {
     
    948965             */
    949966            do_action( 'preprocess_signup_form' );
    950             if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) {
     967            if ( is_user_logged_in() && ( 'all' === $active_signup || 'blog' === $active_signup ) ) {
    951968                signup_another_blog( $newblogname );
    952             } elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) ) {
     969            } elseif ( ! is_user_logged_in() && ( 'all' === $active_signup || 'user' === $active_signup ) ) {
    953970                signup_user( $newblogname, $user_email );
    954             } elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) ) {
     971            } elseif ( ! is_user_logged_in() && ( 'blog' === $active_signup ) ) {
    955972                _e( 'Sorry, new registrations are not allowed at this time.' );
    956973            } else {
     
    961978                $newblog = get_blogaddress_by_name( $newblogname );
    962979
    963                 if ( $active_signup == 'blog' || $active_signup == 'all' ) {
     980                if ( 'blog' === $active_signup || 'all' === $active_signup ) {
    964981                    printf(
    965982                        /* translators: %s: site address */
Note: See TracChangeset for help on using the changeset viewer.