@@ -103,14 +103,15 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
103
103
}
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> ' ;
109
109
} else {
110
110
echo '<label for="blogname"> ' . __ ( 'Site Domain: ' ) . '</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>
116
117
<?php
@@ -119,7 +120,8 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
119
120
if ( ! is_subdomain_install () ) {
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
125
127
if ( ! is_user_logged_in () ) {
@@ -136,7 +138,10 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
136
138
// Blog Title
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
142
147
}
@@ -178,7 +183,8 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
178
183
<?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" ' ;
184
190
} else {
@@ -245,20 +251,25 @@ function show_user_form( $user_name = '', $user_email = '', $errors = '' ) {
245
251
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
}
251
258
echo '<input name="user_name" type="text" id="user_name" value=" ' . esc_attr ( $ user_name ) . '" autocapitalize="none" autocorrect="off" maxlength="60" /><br /> ' ;
252
259
_e ( '(Must be at least 4 characters, letters and numbers only.) ' );
253
260
?>
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
}
264
275
/**
@@ -332,8 +343,11 @@ function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) {
332
343
?>
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>
339
353
@@ -587,9 +601,9 @@ function signup_user( $user_name = '', $user_email = '', $errors = '' ) {
587
601
<?php show_user_form ( $ user_name , $ user_email , $ errors ); ?>
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 { ?>
595
609
<input id="signupblog" type="radio" name="signup_for" value="blog" <?php checked ( $ signup_for , 'blog ' ); ?> />
@@ -912,24 +926,27 @@ function signup_get_available_languages() {
912
926
$ newblogname = isset ( $ _GET ['new ' ] ) ? strtolower ( preg_replace ( '/^-|-$|[^-a-zA-Z0-9]/ ' , '' , $ _GET ['new ' ] ) ) : null ;
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 */
920
934
printf ( __ ( 'You must first <a href="%s">log in</a>, and then you can create a new site. ' ), $ login_url );
921
935
} else {
922
936
$ stage = isset ( $ _POST ['stage ' ] ) ? $ _POST ['stage ' ] : 'default ' ;
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 {
928
945
_e ( 'User registration has been disabled. ' );
929
946
}
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 {
935
952
_e ( 'Site registration has been disabled. ' );
@@ -947,11 +964,11 @@ function signup_get_available_languages() {
947
964
* @since 3.0.0
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 {
957
974
_e ( 'You are logged in already. No need to register again! ' );
@@ -960,7 +977,7 @@ function signup_get_available_languages() {
960
977
if ( $ newblogname ) {
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 */
966
983
'<p><em> ' . __ ( 'The site you were looking for, %s, does not exist, but you can create it now! ' ) . '</em></p> ' ,
0 commit comments