Changeset 44626 for trunk/src/wp-signup.php
- Timestamp:
- 01/16/2019 04:50:15 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-signup.php
r44574 r44626 104 104 105 105 $current_network = get_network(); 106 // Blog name 106 // Blog name. 107 107 if ( ! is_subdomain_install() ) { 108 108 echo '<label for="blogname">' . __( 'Site Name:' ) . '</label>'; … … 111 111 } 112 112 113 if ( $errmsg = $errors->get_error_message( 'blogname' ) ) { 113 $errmsg = $errors->get_error_message( 'blogname' ); 114 if ( $errmsg ) { 114 115 ?> 115 116 <p class="error"><?php echo $errmsg; ?></p> … … 120 121 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 />'; 121 122 } 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 />'; 123 125 } 124 126 … … 137 139 ?> 138 140 <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 ?> 140 145 <p class="error"><?php echo $errmsg; ?></p> 141 146 <?php … … 179 184 endif; // Languages. 180 185 181 $blog_public_on_checked = $blog_public_off_checked = ''; 186 $blog_public_on_checked = ''; 187 $blog_public_off_checked = ''; 182 188 if ( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) { 183 189 $blog_public_off_checked = 'checked="checked"'; … … 246 252 // User name 247 253 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 ) { 249 256 echo '<p class="error">' . $errmsg . '</p>'; 250 257 } … … 254 261 255 262 <label for="user_email"><?php _e( 'Email 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 ?> 257 267 <p class="error"><?php echo $errmsg; ?></p> 258 268 <?php } ?> 259 269 <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.)' ); ?> 260 270 <?php 261 if ( $errmsg = $errors->get_error_message( 'generic' ) ) { 271 $errmsg = $errors->get_error_message( 'generic' ); 272 if ( $errmsg ) { 262 273 echo '<p class="error">' . $errmsg . '</p>'; 263 274 } … … 333 344 <p> 334 345 <?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’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’s content, but write responsibly!' ), 349 $current_user->display_name 350 ); 337 351 ?> 338 352 </p> … … 588 602 589 603 <p> 590 <?php if ( $active_signup == 'blog') { ?>604 <?php if ( 'blog' === $active_signup ) { ?> 591 605 <input id="signupblog" type="hidden" name="signup_for" value="blog" /> 592 <?php } elseif ( $active_signup == 'user') { ?>606 <?php } elseif ( 'user' === $active_signup ) { ?> 593 607 <input id="signupblog" type="hidden" name="signup_for" value="user" /> 594 608 <?php } else { ?> … … 913 927 914 928 $current_user = wp_get_current_user(); 915 if ( $active_signup == 'none') {929 if ( 'none' === $active_signup ) { 916 930 _e( 'Registration has been disabled.' ); 917 } elseif ( $active_signup == 'blog'&& ! is_user_logged_in() ) {931 } elseif ( 'blog' === $active_signup && ! is_user_logged_in() ) { 918 932 $login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); 919 933 /* translators: %s: login URL */ … … 923 937 switch ( $stage ) { 924 938 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 ) { 926 943 validate_user_signup(); 927 944 } else { … … 930 947 break; 931 948 case 'validate-blog-signup': 932 if ( $active_signup == 'all' || $active_signup == 'blog') {949 if ( 'all' === $active_signup || 'blog' === $active_signup ) { 933 950 validate_blog_signup(); 934 951 } else { … … 948 965 */ 949 966 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 ) ) { 951 968 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 ) ) { 953 970 signup_user( $newblogname, $user_email ); 954 } elseif ( ! is_user_logged_in() && ( $active_signup == 'blog') ) {971 } elseif ( ! is_user_logged_in() && ( 'blog' === $active_signup ) ) { 955 972 _e( 'Sorry, new registrations are not allowed at this time.' ); 956 973 } else { … … 961 978 $newblog = get_blogaddress_by_name( $newblogname ); 962 979 963 if ( $active_signup == 'blog' || $active_signup == 'all') {980 if ( 'blog' === $active_signup || 'all' === $active_signup ) { 964 981 printf( 965 982 /* translators: %s: site address */
Note: See TracChangeset
for help on using the changeset viewer.