Make WordPress Core


Ignore:
Timestamp:
08/15/2018 06:22:00 AM (6 years ago)
Author:
pento
Message:

Coding Standards: Prepare for upgrading WPCS to 1.0.0.

In order to get the best result when running phpcbf across the codebase, there are some manual tweaks we need to make.

These fall into three categories:

  • Fixing incorrectly indented code which has flow-on effects when auto-fixing.
  • Tweaking the layout of inline PHP inside HTML tags.
  • Moving more complex inline PHP inside HTML tags, to execute earlier.

See #44600.

File:
1 edited

Legend:

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

    r43065 r43569  
    7777<div id="signup-content" class="widecolumn">
    7878    <div class="wp-activate-container">
    79     <?php if ( empty( $_GET['key'] ) && empty( $_POST['key'] ) ) { ?>
     79    <?php
     80    if ( empty( $_GET['key'] ) && empty( $_POST['key'] ) ) {
     81        ?>
    8082
    8183        <h2><?php _e( 'Activation Key Required' ); ?></h2>
     
    9092        </form>
    9193
    92     <?php
    93 } else {
     94        <?php
     95    } else {
    9496
    95     $key    = ! empty( $_GET['key'] ) ? $_GET['key'] : $_POST['key'];
    96     $result = wpmu_activate_signup( $key );
    97     if ( is_wp_error( $result ) ) {
    98         if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
    99             $signup = $result->get_error_data();
     97        $key    = ! empty( $_GET['key'] ) ? $_GET['key'] : $_POST['key'];
     98        $result = wpmu_activate_signup( $key );
     99        if ( is_wp_error( $result ) ) {
     100            if ( 'already_active' == $result->get_error_code() || 'blog_taken' == $result->get_error_code() ) {
     101                $signup = $result->get_error_data();
     102                ?>
     103                <h2><?php _e( 'Your account is now active!' ); ?></h2>
     104                    <?php
     105                    echo '<p class="lead-in">';
     106                    if ( $signup->domain . $signup->path == '' ) {
     107                        printf(
     108                            /* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */
     109                            __( 'Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
     110                            network_site_url( 'wp-login.php', 'login' ),
     111                            $signup->user_login,
     112                            $signup->user_email,
     113                            wp_lostpassword_url()
     114                        );
     115                    } else {
     116                        printf(
     117                            /* translators: 1: site URL, 2: username, 3: user email, 4: lost password URL */
     118                            __( 'Your site at %1$s is active. You may now log in to your site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
     119                            sprintf( '<a href="http://%1$s">%1$s</a>', $signup->domain ),
     120                            $signup->user_login,
     121                            $signup->user_email,
     122                            wp_lostpassword_url()
     123                        );
     124                    }
     125                    echo '</p>';
     126            } else {
     127                ?>
     128                <h2><?php _e( 'An error occurred during the activation' ); ?></h2>
     129                <p><?php echo $result->get_error_message(); ?></p>
     130                <?php
     131            }
     132        } else {
     133            $url  = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';
     134            $user = get_userdata( (int) $result['user_id'] );
    100135            ?>
    101136            <h2><?php _e( 'Your account is now active!' ); ?></h2>
    102                 <?php
    103                 echo '<p class="lead-in">';
    104                 if ( $signup->domain . $signup->path == '' ) {
    105                     printf(
    106                         /* translators: 1: login URL, 2: username, 3: user email, 4: lost password URL */
    107                         __( 'Your account has been activated. You may now <a href="%1$s">log in</a> to the site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
    108                         network_site_url( 'wp-login.php', 'login' ),
    109                         $signup->user_login,
    110                         $signup->user_email,
    111                         wp_lostpassword_url()
    112                     );
    113                 } else {
    114                     printf(
    115                         /* translators: 1: site URL, 2: username, 3: user email, 4: lost password URL */
    116                         __( 'Your site at %1$s is active. You may now log in to your site using your chosen username of &#8220;%2$s&#8221;. Please check your email inbox at %3$s for your password and login instructions. If you do not receive an email, please check your junk or spam folder. If you still do not receive an email within an hour, you can <a href="%4$s">reset your password</a>.' ),
    117                         sprintf( '<a href="http://%1$s">%1$s</a>', $signup->domain ),
    118                         $signup->user_login,
    119                         $signup->user_email,
    120                         wp_lostpassword_url()
    121                     );
    122                 }
    123                 echo '</p>';
    124         } else {
    125             ?>
    126             <h2><?php _e( 'An error occurred during the activation' ); ?></h2>
    127                 <p><?php echo $result->get_error_message(); ?></p>
    128                 <?php
    129         }
    130     } else {
    131         $url  = isset( $result['blog_id'] ) ? get_home_url( (int) $result['blog_id'] ) : '';
    132         $user = get_userdata( (int) $result['user_id'] );
    133         ?>
    134         <h2><?php _e( 'Your account is now active!' ); ?></h2>
    135137
    136138            <div id="signup-welcome">
     
    160162            <?php
    161163            endif;
     164        }
    162165    }
    163 }
    164166    ?>
    165167    </div>
Note: See TracChangeset for help on using the changeset viewer.