author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
2 |
/** |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
3 |
* WordPress Signup Page |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
4 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
5 |
* Handles the user registration and site creation process for multisite installations. |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
6 |
* |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
7 |
* @package WordPress |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
8 |
*/ |
0 | 9 |
|
10 |
/** Sets up the WordPress Environment. */ |
|
16 | 11 |
require __DIR__ . '/wp-load.php'; |
0 | 12 |
|
18 | 13 |
add_filter( 'wp_robots', 'wp_robots_no_robots' ); |
0 | 14 |
|
16 | 15 |
require __DIR__ . '/wp-blog-header.php'; |
0 | 16 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
17 |
nocache_headers(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
18 |
|
16 | 19 |
if ( is_array( get_site_option( 'illegal_names' ) ) && isset( $_GET['new'] ) && in_array( $_GET['new'], get_site_option( 'illegal_names' ), true ) ) { |
0 | 20 |
wp_redirect( network_home_url() ); |
21 |
die(); |
|
22 |
} |
|
23 |
||
24 |
/** |
|
19 | 25 |
* Prints signup_header via wp_head. |
0 | 26 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
27 |
* @since MU (3.0.0) |
0 | 28 |
*/ |
29 |
function do_signup_header() { |
|
30 |
/** |
|
5 | 31 |
* Fires within the head section of the site sign-up screen. |
0 | 32 |
* |
33 |
* @since 3.0.0 |
|
34 |
*/ |
|
35 |
do_action( 'signup_header' ); |
|
36 |
} |
|
37 |
add_action( 'wp_head', 'do_signup_header' ); |
|
38 |
||
9 | 39 |
if ( ! is_multisite() ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
40 |
wp_redirect( wp_registration_url() ); |
0 | 41 |
die(); |
42 |
} |
|
43 |
||
9 | 44 |
if ( ! is_main_site() ) { |
0 | 45 |
wp_redirect( network_site_url( 'wp-signup.php' ) ); |
46 |
die(); |
|
47 |
} |
|
48 |
||
16 | 49 |
// Fix for page title. |
0 | 50 |
$wp_query->is_404 = false; |
51 |
||
52 |
/** |
|
19 | 53 |
* Fires before the Site Sign-up page is loaded. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
54 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
55 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
56 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
57 |
do_action( 'before_signup_header' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
58 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
59 |
/** |
19 | 60 |
* Prints styles for front-end Multisite Sign-up pages. |
0 | 61 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
62 |
* @since MU (3.0.0) |
0 | 63 |
*/ |
64 |
function wpmu_signup_stylesheet() { |
|
65 |
?> |
|
66 |
<style type="text/css"> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
67 |
.mu_register { width: 90%; margin: 0 auto; } |
0 | 68 |
.mu_register form { margin-top: 2em; } |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
69 |
.mu_register fieldset, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
70 |
.mu_register legend { margin: 0; padding: 0; border: none; } |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
71 |
.mu_register .error { padding: 10px; color: #333; background: #ffebe8; border: 1px solid #c00; } |
0 | 72 |
.mu_register input[type="submit"], |
73 |
.mu_register #blog_title, |
|
74 |
.mu_register #user_email, |
|
75 |
.mu_register #blogname, |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
76 |
.mu_register #user_name { width: 100%; font-size: 24px; margin: 5px 0; box-sizing: border-box; } |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
77 |
.mu_register #site-language { display: block; } |
0 | 78 |
.mu_register .prefix_address, |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
79 |
.mu_register .suffix_address { font-size: 18px; display: inline-block; direction: ltr; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
80 |
.mu_register label, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
81 |
.mu_register legend, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
82 |
.mu_register .label-heading { font-weight: 600; font-size: 15px; display: block; margin: 10px 0; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
83 |
.mu_register legend + p, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
84 |
.mu_register input + p { margin-top: 0; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
85 |
.mu_register label.checkbox { display: inline; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
86 |
.mu_register .mu_alert { font-weight: 600; padding: 10px; color: #333; background: #ffffe0; border: 1px solid #e6db55; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
87 |
.mu_register .mu_alert a { color: inherit; text-decoration: underline; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
88 |
.mu_register .signup-options .wp-signup-radio-button { display: block; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
89 |
.mu_register .privacy-intro .wp-signup-radio-button { margin-right: 0.5em; } |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
90 |
.rtl .mu_register .wp-signup-blogname { direction: ltr; text-align: right; } |
0 | 91 |
</style> |
92 |
<?php |
|
93 |
} |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
94 |
add_action( 'wp_head', 'wpmu_signup_stylesheet' ); |
0 | 95 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
96 |
get_header( 'wp-signup' ); |
0 | 97 |
|
98 |
/** |
|
19 | 99 |
* Fires before the site Sign-up form. |
0 | 100 |
* |
101 |
* @since 3.0.0 |
|
102 |
*/ |
|
103 |
do_action( 'before_signup_form' ); |
|
104 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
105 |
<div id="signup-content" class="widecolumn"> |
16 | 106 |
<div class="mu_register wp-signup-container" role="main"> |
0 | 107 |
<?php |
108 |
/** |
|
19 | 109 |
* Generates and displays the Sign-up and Create Site forms. |
0 | 110 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
111 |
* @since MU (3.0.0) |
0 | 112 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
113 |
* @param string $blogname The new site name. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
114 |
* @param string $blog_title The new site title. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
115 |
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. |
0 | 116 |
*/ |
5 | 117 |
function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
118 |
if ( ! is_wp_error( $errors ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
119 |
$errors = new WP_Error(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
120 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
121 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
122 |
$current_network = get_network(); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
123 |
// Site name. |
9 | 124 |
if ( ! is_subdomain_install() ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
125 |
echo '<label for="blogname">' . __( 'Site Name (subdirectory only):' ) . '</label>'; |
9 | 126 |
} else { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
127 |
echo '<label for="blogname">' . __( 'Site Domain (subdomain only):' ) . '</label>'; |
9 | 128 |
} |
0 | 129 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
130 |
$errmsg_blogname = $errors->get_error_message( 'blogname' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
131 |
$errmsg_blogname_aria = ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
132 |
if ( $errmsg_blogname ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
133 |
$errmsg_blogname_aria = 'wp-signup-blogname-error '; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
134 |
echo '<p class="error" id="wp-signup-blogname-error">' . $errmsg_blogname . '</p>'; |
9 | 135 |
} |
0 | 136 |
|
9 | 137 |
if ( ! is_subdomain_install() ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
138 |
echo '<div class="wp-signup-blogname"><span class="prefix_address" id="prefix-address">' . $current_network->domain . $current_network->path . '</span><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" required="required" aria-describedby="' . $errmsg_blogname_aria . 'prefix-address" /></div>'; |
9 | 139 |
} else { |
140 |
$site_domain = preg_replace( '|^www\.|', '', $current_network->domain ); |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
141 |
echo '<div class="wp-signup-blogname"><input name="blogname" type="text" id="blogname" value="' . esc_attr( $blogname ) . '" maxlength="60" autocomplete="off" required="required" aria-describedby="' . $errmsg_blogname_aria . 'suffix-address" /><span class="suffix_address" id="suffix-address">.' . esc_html( $site_domain ) . '</span></div>'; |
9 | 142 |
} |
0 | 143 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
144 |
if ( ! is_user_logged_in() ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
145 |
if ( ! is_subdomain_install() ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
146 |
$site = $current_network->domain . $current_network->path . __( 'sitename' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
147 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
148 |
$site = __( 'domain' ) . '.' . $site_domain . $current_network->path; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
149 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
150 |
|
16 | 151 |
printf( |
152 |
'<p>(<strong>%s</strong>) %s</p>', |
|
153 |
/* translators: %s: Site address. */ |
|
154 |
sprintf( __( 'Your address will be %s.' ), $site ), |
|
155 |
__( 'Must be at least 4 characters, letters and numbers only. It cannot be changed, so choose carefully!' ) |
|
156 |
); |
|
0 | 157 |
} |
158 |
||
16 | 159 |
// Site Title. |
0 | 160 |
?> |
9 | 161 |
<label for="blog_title"><?php _e( 'Site Title:' ); ?></label> |
162 |
<?php |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
163 |
$errmsg_blog_title = $errors->get_error_message( 'blog_title' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
164 |
$errmsg_blog_title_aria = ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
165 |
if ( $errmsg_blog_title ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
166 |
$errmsg_blog_title_aria = ' aria-describedby="wp-signup-blog-title-error"'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
167 |
echo '<p class="error" id="wp-signup-blog-title-error">' . $errmsg_blog_title . '</p>'; |
9 | 168 |
} |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
169 |
echo '<input name="blog_title" type="text" id="blog_title" value="' . esc_attr( $blog_title ) . '" required="required" autocomplete="off"' . $errmsg_blog_title_aria . ' />'; |
0 | 170 |
?> |
171 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
172 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
173 |
// Site Language. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
174 |
$languages = signup_get_available_languages(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
175 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
176 |
if ( ! empty( $languages ) ) : |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
177 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
178 |
<p> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
179 |
<label for="site-language"><?php _e( 'Site Language:' ); ?></label> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
180 |
<?php |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
181 |
// Network default. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
182 |
$lang = get_site_option( 'WPLANG' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
183 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
184 |
if ( isset( $_POST['WPLANG'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
185 |
$lang = $_POST['WPLANG']; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
186 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
187 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
188 |
// Use US English if the default isn't available. |
16 | 189 |
if ( ! in_array( $lang, $languages, true ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
190 |
$lang = ''; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
191 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
192 |
|
9 | 193 |
wp_dropdown_languages( |
194 |
array( |
|
195 |
'name' => 'WPLANG', |
|
196 |
'id' => 'site-language', |
|
197 |
'selected' => $lang, |
|
198 |
'languages' => $languages, |
|
199 |
'show_available_translations' => false, |
|
200 |
) |
|
201 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
202 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
203 |
</p> |
9 | 204 |
<?php |
205 |
endif; // Languages. |
|
206 |
||
207 |
$blog_public_on_checked = ''; |
|
208 |
$blog_public_off_checked = ''; |
|
16 | 209 |
if ( isset( $_POST['blog_public'] ) && '0' === $_POST['blog_public'] ) { |
9 | 210 |
$blog_public_off_checked = 'checked="checked"'; |
211 |
} else { |
|
212 |
$blog_public_on_checked = 'checked="checked"'; |
|
213 |
} |
|
214 |
?> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
215 |
|
0 | 216 |
<div id="privacy"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
217 |
<fieldset class="privacy-intro"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
218 |
<legend> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
219 |
<span class="label-heading"><?php _e( 'Privacy:' ); ?></span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
220 |
<?php _e( 'Allow search engines to index this site.' ); ?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
221 |
</legend> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
222 |
<p class="wp-signup-radio-buttons"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
223 |
<span class="wp-signup-radio-button"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
224 |
<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> /> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
225 |
<label class="checkbox" for="blog_public_on"><?php _e( 'Yes' ); ?></label> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
226 |
</span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
227 |
<span class="wp-signup-radio-button"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
228 |
<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php echo $blog_public_off_checked; ?> /> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
229 |
<label class="checkbox" for="blog_public_off"><?php _e( 'No' ); ?></label> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
230 |
</span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
231 |
</p> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
232 |
</fieldset> |
0 | 233 |
</div> |
234 |
||
235 |
<?php |
|
236 |
/** |
|
237 |
* Fires after the site sign-up form. |
|
238 |
* |
|
239 |
* @since 3.0.0 |
|
240 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
241 |
* @param WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors. |
0 | 242 |
*/ |
243 |
do_action( 'signup_blogform', $errors ); |
|
244 |
} |
|
245 |
||
246 |
/** |
|
19 | 247 |
* Validates the new site sign-up. |
0 | 248 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
249 |
* @since MU (3.0.0) |
0 | 250 |
* |
251 |
* @return array Contains the new site data and error messages. |
|
18 | 252 |
* See wpmu_validate_blog_signup() for details. |
0 | 253 |
*/ |
254 |
function validate_blog_form() { |
|
255 |
$user = ''; |
|
9 | 256 |
if ( is_user_logged_in() ) { |
0 | 257 |
$user = wp_get_current_user(); |
9 | 258 |
} |
0 | 259 |
|
9 | 260 |
return wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'], $user ); |
0 | 261 |
} |
262 |
||
263 |
/** |
|
18 | 264 |
* Displays the fields for the new user account registration form. |
0 | 265 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
266 |
* @since MU (3.0.0) |
0 | 267 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
268 |
* @param string $user_name The entered username. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
269 |
* @param string $user_email The entered email address. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
270 |
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. |
0 | 271 |
*/ |
9 | 272 |
function show_user_form( $user_name = '', $user_email = '', $errors = '' ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
273 |
if ( ! is_wp_error( $errors ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
274 |
$errors = new WP_Error(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
275 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
276 |
|
16 | 277 |
// Username. |
9 | 278 |
echo '<label for="user_name">' . __( 'Username:' ) . '</label>'; |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
279 |
$errmsg_username = $errors->get_error_message( 'user_name' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
280 |
$errmsg_username_aria = ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
281 |
if ( $errmsg_username ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
282 |
$errmsg_username_aria = 'wp-signup-username-error '; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
283 |
echo '<p class="error" id="wp-signup-username-error">' . $errmsg_username . '</p>'; |
0 | 284 |
} |
285 |
?> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
286 |
<input name="user_name" type="text" id="user_name" value="<?php echo esc_attr( $user_name ); ?>" autocapitalize="none" autocorrect="off" maxlength="60" autocomplete="username" required="required" aria-describedby="<?php echo $errmsg_username_aria; ?>wp-signup-username-description" /> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
287 |
<p id="wp-signup-username-description"><?php _e( '(Must be at least 4 characters, lowercase letters and numbers only.)' ); ?></p> |
0 | 288 |
|
9 | 289 |
<?php |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
290 |
// Email address. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
291 |
echo '<label for="user_email">' . __( 'Email Address:' ) . '</label>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
292 |
$errmsg_email = $errors->get_error_message( 'user_email' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
293 |
$errmsg_email_aria = ''; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
294 |
if ( $errmsg_email ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
295 |
$errmsg_email_aria = 'wp-signup-email-error '; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
296 |
echo '<p class="error" id="wp-signup-email-error">' . $errmsg_email . '</p>'; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
297 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
298 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
299 |
<input name="user_email" type="email" id="user_email" value="<?php echo esc_attr( $user_email ); ?>" maxlength="200" autocomplete="email" required="required" aria-describedby="<?php echo $errmsg_email_aria; ?>wp-signup-email-description" /> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
300 |
<p id="wp-signup-email-description"><?php _e( 'Your registration email is sent to this address. (Double-check your email address before continuing.)' ); ?></p> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
301 |
|
0 | 302 |
<?php |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
303 |
// Extra fields. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
304 |
$errmsg_generic = $errors->get_error_message( 'generic' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
305 |
if ( $errmsg_generic ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
306 |
echo '<p class="error" id="wp-signup-generic-error">' . $errmsg_generic . '</p>'; |
0 | 307 |
} |
308 |
/** |
|
18 | 309 |
* Fires at the end of the new user account registration form. |
0 | 310 |
* |
311 |
* @since 3.0.0 |
|
312 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
313 |
* @param WP_Error $errors A WP_Error object containing 'user_name' or 'user_email' errors. |
0 | 314 |
*/ |
315 |
do_action( 'signup_extra_fields', $errors ); |
|
316 |
} |
|
317 |
||
318 |
/** |
|
19 | 319 |
* Validates user sign-up name and email. |
0 | 320 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
321 |
* @since MU (3.0.0) |
0 | 322 |
* |
323 |
* @return array Contains username, email, and error messages. |
|
18 | 324 |
* See wpmu_validate_user_signup() for details. |
0 | 325 |
*/ |
326 |
function validate_user_form() { |
|
9 | 327 |
return wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] ); |
0 | 328 |
} |
329 |
||
330 |
/** |
|
19 | 331 |
* Shows a form for returning users to sign up for another site. |
0 | 332 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
333 |
* @since MU (3.0.0) |
0 | 334 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
335 |
* @param string $blogname The new site name |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
336 |
* @param string $blog_title The new site title. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
337 |
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. |
0 | 338 |
*/ |
5 | 339 |
function signup_another_blog( $blogname = '', $blog_title = '', $errors = '' ) { |
0 | 340 |
$current_user = wp_get_current_user(); |
341 |
||
9 | 342 |
if ( ! is_wp_error( $errors ) ) { |
0 | 343 |
$errors = new WP_Error(); |
344 |
} |
|
345 |
||
346 |
$signup_defaults = array( |
|
347 |
'blogname' => $blogname, |
|
348 |
'blog_title' => $blog_title, |
|
9 | 349 |
'errors' => $errors, |
0 | 350 |
); |
351 |
||
352 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
353 |
* Filters the default site sign-up variables. |
0 | 354 |
* |
355 |
* @since 3.0.0 |
|
356 |
* |
|
357 |
* @param array $signup_defaults { |
|
358 |
* An array of default site sign-up variables. |
|
359 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
360 |
* @type string $blogname The site blogname. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
361 |
* @type string $blog_title The site title. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
362 |
* @type WP_Error $errors A WP_Error object possibly containing 'blogname' or 'blog_title' errors. |
0 | 363 |
* } |
364 |
*/ |
|
365 |
$filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults ); |
|
366 |
||
9 | 367 |
$blogname = $filtered_results['blogname']; |
0 | 368 |
$blog_title = $filtered_results['blog_title']; |
9 | 369 |
$errors = $filtered_results['errors']; |
0 | 370 |
|
16 | 371 |
/* translators: %s: Network title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
372 |
echo '<h2>' . sprintf( __( 'Get <em>another</em> %s site in seconds' ), get_network()->site_name ) . '</h2>'; |
0 | 373 |
|
9 | 374 |
if ( $errors->has_errors() ) { |
0 | 375 |
echo '<p>' . __( 'There was a problem, please correct the form below and try again.' ) . '</p>'; |
376 |
} |
|
377 |
?> |
|
9 | 378 |
<p> |
379 |
<?php |
|
380 |
printf( |
|
381 |
/* translators: %s: Current user's display name. */ |
|
382 |
__( '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!' ), |
|
383 |
$current_user->display_name |
|
384 |
); |
|
385 |
?> |
|
386 |
</p> |
|
0 | 387 |
|
388 |
<?php |
|
9 | 389 |
$blogs = get_blogs_of_user( $current_user->ID ); |
390 |
if ( ! empty( $blogs ) ) { |
|
391 |
?> |
|
0 | 392 |
|
9 | 393 |
<p><?php _e( 'Sites you are already a member of:' ); ?></p> |
0 | 394 |
<ul> |
9 | 395 |
<?php |
396 |
foreach ( $blogs as $blog ) { |
|
0 | 397 |
$home_url = get_home_url( $blog->userblog_id ); |
398 |
echo '<li><a href="' . esc_url( $home_url ) . '">' . $home_url . '</a></li>'; |
|
9 | 399 |
} |
400 |
?> |
|
0 | 401 |
</ul> |
402 |
<?php } ?> |
|
403 |
||
19 | 404 |
<p><?php _e( 'If you are not going to use a great site domain, leave it for a new user. Now have at it!' ); ?></p> |
0 | 405 |
<form id="setupform" method="post" action="wp-signup.php"> |
406 |
<input type="hidden" name="stage" value="gimmeanotherblog" /> |
|
407 |
<?php |
|
408 |
/** |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
409 |
* Fires when hidden sign-up form fields output when creating another site or user. |
0 | 410 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
411 |
* @since MU (3.0.0) |
0 | 412 |
* |
413 |
* @param string $context A string describing the steps of the sign-up process. The value can be |
|
414 |
* 'create-another-site', 'validate-user', or 'validate-site'. |
|
415 |
*/ |
|
416 |
do_action( 'signup_hidden_fields', 'create-another-site' ); |
|
417 |
?> |
|
9 | 418 |
<?php show_blog_form( $blogname, $blog_title, $errors ); ?> |
419 |
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ); ?>" /></p> |
|
0 | 420 |
</form> |
421 |
<?php |
|
422 |
} |
|
423 |
||
424 |
/** |
|
19 | 425 |
* Validates a new site sign-up for an existing user. |
0 | 426 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
427 |
* @since MU (3.0.0) |
0 | 428 |
* |
19 | 429 |
* @global string $blogname The new site's subdomain or directory name. |
430 |
* @global string $blog_title The new site's title. |
|
431 |
* @global WP_Error $errors Existing errors in the global scope. |
|
432 |
* @global string $domain The new site's domain. |
|
433 |
* @global string $path The new site's path. |
|
434 |
* |
|
435 |
* @return null|bool True if site signup was validated, false on error. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
436 |
* The function halts all execution if the user is not logged in. |
0 | 437 |
*/ |
438 |
function validate_another_blog_signup() { |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
439 |
global $blogname, $blog_title, $errors, $domain, $path; |
0 | 440 |
$current_user = wp_get_current_user(); |
5 | 441 |
if ( ! is_user_logged_in() ) { |
0 | 442 |
die(); |
5 | 443 |
} |
0 | 444 |
|
445 |
$result = validate_blog_form(); |
|
5 | 446 |
|
447 |
// Extracted values set/overwrite globals. |
|
9 | 448 |
$domain = $result['domain']; |
449 |
$path = $result['path']; |
|
450 |
$blogname = $result['blogname']; |
|
5 | 451 |
$blog_title = $result['blog_title']; |
9 | 452 |
$errors = $result['errors']; |
0 | 453 |
|
9 | 454 |
if ( $errors->has_errors() ) { |
455 |
signup_another_blog( $blogname, $blog_title, $errors ); |
|
0 | 456 |
return false; |
457 |
} |
|
458 |
||
459 |
$public = (int) $_POST['blog_public']; |
|
460 |
||
461 |
$blog_meta_defaults = array( |
|
462 |
'lang_id' => 1, |
|
9 | 463 |
'public' => $public, |
0 | 464 |
); |
465 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
466 |
// Handle the language setting for the new site. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
467 |
if ( ! empty( $_POST['WPLANG'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
468 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
469 |
$languages = signup_get_available_languages(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
470 |
|
16 | 471 |
if ( in_array( $_POST['WPLANG'], $languages, true ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
472 |
$language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
473 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
474 |
if ( $language ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
475 |
$blog_meta_defaults['WPLANG'] = $language; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
476 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
477 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
478 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
479 |
|
0 | 480 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
481 |
* Filters the new site meta variables. |
0 | 482 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
483 |
* Use the {@see 'add_signup_meta'} filter instead. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
484 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
485 |
* @since MU (3.0.0) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
486 |
* @deprecated 3.0.0 Use the {@see 'add_signup_meta'} filter instead. |
0 | 487 |
* |
488 |
* @param array $blog_meta_defaults An array of default blog meta variables. |
|
489 |
*/ |
|
16 | 490 |
$meta_defaults = apply_filters_deprecated( 'signup_create_blog_meta', array( $blog_meta_defaults ), '3.0.0', 'add_signup_meta' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
491 |
|
0 | 492 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
493 |
* Filters the new default site meta variables. |
0 | 494 |
* |
495 |
* @since 3.0.0 |
|
496 |
* |
|
497 |
* @param array $meta { |
|
498 |
* An array of default site meta variables. |
|
499 |
* |
|
500 |
* @type int $lang_id The language ID. |
|
501 |
* @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false. |
|
502 |
* } |
|
503 |
*/ |
|
5 | 504 |
$meta = apply_filters( 'add_signup_meta', $meta_defaults ); |
0 | 505 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
506 |
$blog_id = wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, get_current_network_id() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
507 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
508 |
if ( is_wp_error( $blog_id ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
509 |
return false; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
510 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
511 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
512 |
confirm_another_blog_signup( $domain, $path, $blog_title, $current_user->user_login, $current_user->user_email, $meta, $blog_id ); |
0 | 513 |
return true; |
514 |
} |
|
515 |
||
516 |
/** |
|
19 | 517 |
* Shows a message confirming that the new site has been created. |
0 | 518 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
519 |
* @since MU (3.0.0) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
520 |
* @since 4.4.0 Added the `$blog_id` parameter. |
0 | 521 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
522 |
* @param string $domain The domain URL. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
523 |
* @param string $path The site root path. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
524 |
* @param string $blog_title The site title. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
525 |
* @param string $user_name The username. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
526 |
* @param string $user_email The user's email address. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
527 |
* @param array $meta Any additional meta from the {@see 'add_signup_meta'} filter in validate_blog_signup(). |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
528 |
* @param int $blog_id The site ID. |
0 | 529 |
*/ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
530 |
function confirm_another_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = array(), $blog_id = 0 ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
531 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
532 |
if ( $blog_id ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
533 |
switch_to_blog( $blog_id ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
534 |
$home_url = home_url( '/' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
535 |
$login_url = wp_login_url(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
536 |
restore_current_blog(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
537 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
538 |
$home_url = 'http://' . $domain . $path; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
539 |
$login_url = 'http://' . $domain . $path . 'wp-login.php'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
540 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
541 |
|
9 | 542 |
$site = sprintf( |
543 |
'<a href="%1$s">%2$s</a>', |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
544 |
esc_url( $home_url ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
545 |
$blog_title |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
546 |
); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
547 |
|
0 | 548 |
?> |
9 | 549 |
<h2> |
550 |
<?php |
|
16 | 551 |
/* translators: %s: Site title. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
552 |
printf( __( 'The site %s is yours.' ), $site ); |
9 | 553 |
?> |
554 |
</h2> |
|
0 | 555 |
<p> |
9 | 556 |
<?php |
557 |
printf( |
|
16 | 558 |
/* translators: 1: Link to new site, 2: Login URL, 3: Username. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
559 |
__( '%1$s is your new site. <a href="%2$s">Log in</a> as “%3$s” using your existing password.' ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
560 |
sprintf( |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
561 |
'<a href="%s">%s</a>', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
562 |
esc_url( $home_url ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
563 |
untrailingslashit( $domain . $path ) |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
564 |
), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
565 |
esc_url( $login_url ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
566 |
$user_name |
9 | 567 |
); |
568 |
?> |
|
0 | 569 |
</p> |
570 |
<?php |
|
571 |
/** |
|
572 |
* Fires when the site or user sign-up process is complete. |
|
573 |
* |
|
574 |
* @since 3.0.0 |
|
575 |
*/ |
|
576 |
do_action( 'signup_finished' ); |
|
577 |
} |
|
578 |
||
579 |
/** |
|
18 | 580 |
* Shows a form for a visitor to sign up for a new user account. |
0 | 581 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
582 |
* @since MU (3.0.0) |
0 | 583 |
* |
19 | 584 |
* @global string $active_signup String that returns registration type. The value can be |
585 |
* 'all', 'none', 'blog', or 'user'. |
|
586 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
587 |
* @param string $user_name The username. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
588 |
* @param string $user_email The user's email. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
589 |
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. |
0 | 590 |
*/ |
5 | 591 |
function signup_user( $user_name = '', $user_email = '', $errors = '' ) { |
592 |
global $active_signup; |
|
0 | 593 |
|
9 | 594 |
if ( ! is_wp_error( $errors ) ) { |
0 | 595 |
$errors = new WP_Error(); |
9 | 596 |
} |
0 | 597 |
|
9 | 598 |
$signup_for = isset( $_POST['signup_for'] ) ? esc_html( $_POST['signup_for'] ) : 'blog'; |
0 | 599 |
|
600 |
$signup_user_defaults = array( |
|
601 |
'user_name' => $user_name, |
|
602 |
'user_email' => $user_email, |
|
603 |
'errors' => $errors, |
|
604 |
); |
|
605 |
||
606 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
607 |
* Filters the default user variables used on the user sign-up form. |
0 | 608 |
* |
609 |
* @since 3.0.0 |
|
610 |
* |
|
611 |
* @param array $signup_user_defaults { |
|
612 |
* An array of default user variables. |
|
613 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
614 |
* @type string $user_name The user username. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
615 |
* @type string $user_email The user email address. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
616 |
* @type WP_Error $errors A WP_Error object with possible errors relevant to the sign-up user. |
0 | 617 |
* } |
618 |
*/ |
|
619 |
$filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults ); |
|
9 | 620 |
$user_name = $filtered_results['user_name']; |
621 |
$user_email = $filtered_results['user_email']; |
|
622 |
$errors = $filtered_results['errors']; |
|
0 | 623 |
|
624 |
?> |
|
625 |
||
9 | 626 |
<h2> |
627 |
<?php |
|
16 | 628 |
/* translators: %s: Name of the network. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
629 |
printf( __( 'Get your own %s account in seconds' ), get_network()->site_name ); |
9 | 630 |
?> |
631 |
</h2> |
|
5 | 632 |
<form id="setupform" method="post" action="wp-signup.php" novalidate="novalidate"> |
0 | 633 |
<input type="hidden" name="stage" value="validate-user-signup" /> |
634 |
<?php |
|
635 |
/** This action is documented in wp-signup.php */ |
|
636 |
do_action( 'signup_hidden_fields', 'validate-user' ); |
|
637 |
?> |
|
9 | 638 |
<?php show_user_form( $user_name, $user_email, $errors ); ?> |
0 | 639 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
640 |
<?php if ( 'blog' === $active_signup ) : ?> |
0 | 641 |
<input id="signupblog" type="hidden" name="signup_for" value="blog" /> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
642 |
<?php elseif ( 'user' === $active_signup ) : ?> |
0 | 643 |
<input id="signupblog" type="hidden" name="signup_for" value="user" /> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
644 |
<?php else : ?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
645 |
<fieldset class="signup-options"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
646 |
<legend><?php _e( 'Create a site or only a username:' ); ?></legend> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
647 |
<p class="wp-signup-radio-buttons"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
648 |
<span class="wp-signup-radio-button"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
649 |
<input id="signupblog" type="radio" name="signup_for" value="blog" <?php checked( $signup_for, 'blog' ); ?> /> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
650 |
<label class="checkbox" for="signupblog"><?php _e( 'Gimme a site!' ); ?></label> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
651 |
</span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
652 |
<span class="wp-signup-radio-button"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
653 |
<input id="signupuser" type="radio" name="signup_for" value="user" <?php checked( $signup_for, 'user' ); ?> /> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
654 |
<label class="checkbox" for="signupuser"><?php _e( 'Just a username, please.' ); ?></label> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
655 |
</span> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
656 |
</p> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
657 |
</fieldset> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
658 |
<?php endif; ?> |
0 | 659 |
|
9 | 660 |
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Next' ); ?>" /></p> |
0 | 661 |
</form> |
662 |
<?php |
|
663 |
} |
|
664 |
||
665 |
/** |
|
19 | 666 |
* Validates the new user sign-up. |
0 | 667 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
668 |
* @since MU (3.0.0) |
0 | 669 |
* |
19 | 670 |
* @return bool True if new user sign-up was validated, false on error. |
0 | 671 |
*/ |
672 |
function validate_user_signup() { |
|
9 | 673 |
$result = validate_user_form(); |
674 |
$user_name = $result['user_name']; |
|
5 | 675 |
$user_email = $result['user_email']; |
9 | 676 |
$errors = $result['errors']; |
0 | 677 |
|
9 | 678 |
if ( $errors->has_errors() ) { |
679 |
signup_user( $user_name, $user_email, $errors ); |
|
0 | 680 |
return false; |
681 |
} |
|
682 |
||
16 | 683 |
if ( 'blog' === $_POST['signup_for'] ) { |
9 | 684 |
signup_blog( $user_name, $user_email ); |
0 | 685 |
return false; |
686 |
} |
|
687 |
||
688 |
/** This filter is documented in wp-signup.php */ |
|
689 |
wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); |
|
690 |
||
9 | 691 |
confirm_user_signup( $user_name, $user_email ); |
0 | 692 |
return true; |
693 |
} |
|
694 |
||
695 |
/** |
|
19 | 696 |
* Shows a message confirming that the new user has been registered and is awaiting activation. |
0 | 697 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
698 |
* @since MU (3.0.0) |
0 | 699 |
* |
19 | 700 |
* @param string $user_name The username. |
701 |
* @param string $user_email The user's email address. |
|
0 | 702 |
*/ |
9 | 703 |
function confirm_user_signup( $user_name, $user_email ) { |
704 |
?> |
|
705 |
<h2> |
|
706 |
<?php |
|
16 | 707 |
/* translators: %s: Username. */ |
9 | 708 |
printf( __( '%s is your new username' ), $user_name ) |
0 | 709 |
?> |
9 | 710 |
</h2> |
711 |
<p><?php _e( 'But, before you can start using your new username, <strong>you must activate it</strong>.' ); ?></p> |
|
712 |
<p> |
|
713 |
<?php |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
714 |
/* translators: %s: The user email address. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
715 |
printf( __( 'Check your inbox at %s and click on the given link.' ), '<strong>' . $user_email . '</strong>' ); |
9 | 716 |
?> |
717 |
</p> |
|
0 | 718 |
<p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p> |
719 |
<?php |
|
720 |
/** This action is documented in wp-signup.php */ |
|
721 |
do_action( 'signup_finished' ); |
|
722 |
} |
|
723 |
||
724 |
/** |
|
18 | 725 |
* Shows a form for a user or visitor to sign up for a new site. |
0 | 726 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
727 |
* @since MU (3.0.0) |
0 | 728 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
729 |
* @param string $user_name The username. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
730 |
* @param string $user_email The user's email address. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
731 |
* @param string $blogname The site name. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
732 |
* @param string $blog_title The site title. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
733 |
* @param WP_Error|string $errors A WP_Error object containing existing errors. Defaults to empty string. |
0 | 734 |
*/ |
9 | 735 |
function signup_blog( $user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '' ) { |
736 |
if ( ! is_wp_error( $errors ) ) { |
|
0 | 737 |
$errors = new WP_Error(); |
9 | 738 |
} |
0 | 739 |
|
740 |
$signup_blog_defaults = array( |
|
741 |
'user_name' => $user_name, |
|
742 |
'user_email' => $user_email, |
|
743 |
'blogname' => $blogname, |
|
744 |
'blog_title' => $blog_title, |
|
9 | 745 |
'errors' => $errors, |
0 | 746 |
); |
747 |
||
748 |
/** |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
749 |
* Filters the default site creation variables for the site sign-up form. |
0 | 750 |
* |
751 |
* @since 3.0.0 |
|
752 |
* |
|
753 |
* @param array $signup_blog_defaults { |
|
754 |
* An array of default site creation variables. |
|
755 |
* |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
756 |
* @type string $user_name The user username. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
757 |
* @type string $user_email The user email address. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
758 |
* @type string $blogname The blogname. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
759 |
* @type string $blog_title The title of the site. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
760 |
* @type WP_Error $errors A WP_Error object with possible errors relevant to new site creation variables. |
0 | 761 |
* } |
762 |
*/ |
|
763 |
$filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults ); |
|
764 |
||
9 | 765 |
$user_name = $filtered_results['user_name']; |
0 | 766 |
$user_email = $filtered_results['user_email']; |
9 | 767 |
$blogname = $filtered_results['blogname']; |
0 | 768 |
$blog_title = $filtered_results['blog_title']; |
9 | 769 |
$errors = $filtered_results['errors']; |
0 | 770 |
|
9 | 771 |
if ( empty( $blogname ) ) { |
0 | 772 |
$blogname = $user_name; |
9 | 773 |
} |
0 | 774 |
?> |
775 |
<form id="setupform" method="post" action="wp-signup.php"> |
|
776 |
<input type="hidden" name="stage" value="validate-blog-signup" /> |
|
9 | 777 |
<input type="hidden" name="user_name" value="<?php echo esc_attr( $user_name ); ?>" /> |
778 |
<input type="hidden" name="user_email" value="<?php echo esc_attr( $user_email ); ?>" /> |
|
0 | 779 |
<?php |
780 |
/** This action is documented in wp-signup.php */ |
|
781 |
do_action( 'signup_hidden_fields', 'validate-site' ); |
|
782 |
?> |
|
9 | 783 |
<?php show_blog_form( $blogname, $blog_title, $errors ); ?> |
19 | 784 |
<p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Sign up' ); ?>" /></p> |
0 | 785 |
</form> |
786 |
<?php |
|
787 |
} |
|
788 |
||
789 |
/** |
|
19 | 790 |
* Validates new site signup. |
0 | 791 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
792 |
* @since MU (3.0.0) |
0 | 793 |
* |
19 | 794 |
* @return bool True if the site sign-up was validated, false on error. |
0 | 795 |
*/ |
796 |
function validate_blog_signup() { |
|
797 |
// Re-validate user info. |
|
5 | 798 |
$user_result = wpmu_validate_user_signup( $_POST['user_name'], $_POST['user_email'] ); |
9 | 799 |
$user_name = $user_result['user_name']; |
800 |
$user_email = $user_result['user_email']; |
|
5 | 801 |
$user_errors = $user_result['errors']; |
0 | 802 |
|
9 | 803 |
if ( $user_errors->has_errors() ) { |
5 | 804 |
signup_user( $user_name, $user_email, $user_errors ); |
0 | 805 |
return false; |
806 |
} |
|
807 |
||
9 | 808 |
$result = wpmu_validate_blog_signup( $_POST['blogname'], $_POST['blog_title'] ); |
809 |
$domain = $result['domain']; |
|
810 |
$path = $result['path']; |
|
811 |
$blogname = $result['blogname']; |
|
5 | 812 |
$blog_title = $result['blog_title']; |
9 | 813 |
$errors = $result['errors']; |
0 | 814 |
|
9 | 815 |
if ( $errors->has_errors() ) { |
816 |
signup_blog( $user_name, $user_email, $blogname, $blog_title, $errors ); |
|
0 | 817 |
return false; |
818 |
} |
|
819 |
||
9 | 820 |
$public = (int) $_POST['blog_public']; |
821 |
$signup_meta = array( |
|
822 |
'lang_id' => 1, |
|
823 |
'public' => $public, |
|
824 |
); |
|
0 | 825 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
826 |
// Handle the language setting for the new site. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
827 |
if ( ! empty( $_POST['WPLANG'] ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
828 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
829 |
$languages = signup_get_available_languages(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
830 |
|
16 | 831 |
if ( in_array( $_POST['WPLANG'], $languages, true ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
832 |
$language = wp_unslash( sanitize_text_field( $_POST['WPLANG'] ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
833 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
834 |
if ( $language ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
835 |
$signup_meta['WPLANG'] = $language; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
836 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
837 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
838 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
839 |
|
0 | 840 |
/** This filter is documented in wp-signup.php */ |
5 | 841 |
$meta = apply_filters( 'add_signup_meta', $signup_meta ); |
0 | 842 |
|
9 | 843 |
wpmu_signup_blog( $domain, $path, $blog_title, $user_name, $user_email, $meta ); |
844 |
confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email, $meta ); |
|
0 | 845 |
return true; |
846 |
} |
|
847 |
||
848 |
/** |
|
18 | 849 |
* Shows a message confirming that the new site has been registered and is awaiting activation. |
0 | 850 |
* |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
851 |
* @since MU (3.0.0) |
0 | 852 |
* |
18 | 853 |
* @param string $domain The domain or subdomain of the site. |
854 |
* @param string $path The path of the site. |
|
855 |
* @param string $blog_title The title of the new site. |
|
16 | 856 |
* @param string $user_name The user's username. |
857 |
* @param string $user_email The user's email address. |
|
858 |
* @param array $meta Any additional meta from the {@see 'add_signup_meta'} filter in validate_blog_signup(). |
|
0 | 859 |
*/ |
860 |
function confirm_blog_signup( $domain, $path, $blog_title, $user_name = '', $user_email = '', $meta = array() ) { |
|
861 |
?> |
|
9 | 862 |
<h2> |
863 |
<?php |
|
16 | 864 |
/* translators: %s: Site address. */ |
9 | 865 |
printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) |
866 |
?> |
|
867 |
</h2> |
|
0 | 868 |
|
9 | 869 |
<p><?php _e( 'But, before you can start using your site, <strong>you must activate it</strong>.' ); ?></p> |
870 |
<p> |
|
871 |
<?php |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
872 |
/* translators: %s: The user email address. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
873 |
printf( __( 'Check your inbox at %s and click on the given link.' ), '<strong>' . $user_email . '</strong>' ); |
9 | 874 |
?> |
875 |
</p> |
|
0 | 876 |
<p><?php _e( 'If you do not activate your site within two days, you will have to sign up again.' ); ?></p> |
877 |
<h2><?php _e( 'Still waiting for your email?' ); ?></h2> |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
878 |
<p><?php _e( 'If you have not received your email yet, there are a number of things you can do:' ); ?></p> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
879 |
<ul id="noemail-tips"> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
880 |
<li><p><strong><?php _e( 'Wait a little longer. Sometimes delivery of email can be delayed by processes outside of our control.' ); ?></strong></p></li> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
881 |
<li><p><?php _e( 'Check the junk or spam folder of your email client. Sometime emails wind up there by mistake.' ); ?></p></li> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
882 |
<li> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
883 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
884 |
/* translators: %s: Email address. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
885 |
printf( __( 'Have you entered your email correctly? You have entered %s, if it’s incorrect, you will not receive your email.' ), $user_email ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
886 |
?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
887 |
</li> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
888 |
</ul> |
0 | 889 |
<?php |
890 |
/** This action is documented in wp-signup.php */ |
|
891 |
do_action( 'signup_finished' ); |
|
892 |
} |
|
893 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
894 |
/** |
19 | 895 |
* Retrieves languages available during the site/user sign-up process. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
896 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
897 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
898 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
899 |
* @see get_available_languages() |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
900 |
* |
18 | 901 |
* @return string[] Array of available language codes. Language codes are formed by |
902 |
* stripping the .mo extension from the language file names. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
903 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
904 |
function signup_get_available_languages() { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
905 |
/** |
19 | 906 |
* Filters the list of available languages for front-end site sign-ups. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
907 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
908 |
* Passing an empty array to this hook will disable output of the setting on the |
19 | 909 |
* sign-up form, and the default language will be used when creating the site. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
910 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
911 |
* Languages not already installed will be stripped. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
912 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
913 |
* @since 4.4.0 |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
914 |
* |
18 | 915 |
* @param string[] $languages Array of available language codes. Language codes are formed by |
916 |
* stripping the .mo extension from the language file names. |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
917 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
918 |
$languages = (array) apply_filters( 'signup_get_available_languages', get_available_languages() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
919 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
920 |
/* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
921 |
* Strip any non-installed languages and return. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
922 |
* |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
923 |
* Re-call get_available_languages() here in case a language pack was installed |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
924 |
* in a callback hooked to the 'signup_get_available_languages' filter before this point. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
925 |
*/ |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
926 |
return array_intersect_assoc( $languages, get_available_languages() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
927 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
928 |
|
16 | 929 |
// Main. |
0 | 930 |
$active_signup = get_site_option( 'registration', 'none' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
931 |
|
0 | 932 |
/** |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
933 |
* Filters the type of site sign-up. |
0 | 934 |
* |
935 |
* @since 3.0.0 |
|
936 |
* |
|
937 |
* @param string $active_signup String that returns registration type. The value can be |
|
938 |
* 'all', 'none', 'blog', or 'user'. |
|
939 |
*/ |
|
940 |
$active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); |
|
941 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
942 |
if ( current_user_can( 'manage_network' ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
943 |
echo '<div class="mu_alert">'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
944 |
_e( 'Greetings Network Administrator!' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
945 |
echo ' '; |
0 | 946 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
947 |
switch ( $active_signup ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
948 |
case 'none': |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
949 |
_e( 'The network currently disallows registrations.' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
950 |
break; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
951 |
case 'blog': |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
952 |
_e( 'The network currently allows site registrations.' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
953 |
break; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
954 |
case 'user': |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
955 |
_e( 'The network currently allows user registrations.' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
956 |
break; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
957 |
default: |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
958 |
_e( 'The network currently allows both site and user registrations.' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
959 |
break; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
960 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
961 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
962 |
echo ' '; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
963 |
|
16 | 964 |
/* translators: %s: URL to Network Settings screen. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
965 |
printf( __( 'To change or disable registration go to your <a href="%s">Options page</a>.' ), esc_url( network_admin_url( 'settings.php' ) ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
966 |
echo '</div>'; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
967 |
} |
0 | 968 |
|
9 | 969 |
$newblogname = isset( $_GET['new'] ) ? strtolower( preg_replace( '/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'] ) ) : null; |
0 | 970 |
|
971 |
$current_user = wp_get_current_user(); |
|
9 | 972 |
if ( 'none' === $active_signup ) { |
0 | 973 |
_e( 'Registration has been disabled.' ); |
9 | 974 |
} elseif ( 'blog' === $active_signup && ! is_user_logged_in() ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
975 |
$login_url = wp_login_url( network_site_url( 'wp-signup.php' ) ); |
16 | 976 |
/* translators: %s: Login URL. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
977 |
printf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url ); |
0 | 978 |
} else { |
9 | 979 |
$stage = isset( $_POST['stage'] ) ? $_POST['stage'] : 'default'; |
0 | 980 |
switch ( $stage ) { |
9 | 981 |
case 'validate-user-signup': |
982 |
if ( 'all' === $active_signup |
|
983 |
|| ( 'blog' === $_POST['signup_for'] && 'blog' === $active_signup ) |
|
984 |
|| ( 'user' === $_POST['signup_for'] && 'user' === $active_signup ) |
|
985 |
) { |
|
0 | 986 |
validate_user_signup(); |
9 | 987 |
} else { |
0 | 988 |
_e( 'User registration has been disabled.' ); |
9 | 989 |
} |
990 |
break; |
|
0 | 991 |
case 'validate-blog-signup': |
9 | 992 |
if ( 'all' === $active_signup || 'blog' === $active_signup ) { |
0 | 993 |
validate_blog_signup(); |
9 | 994 |
} else { |
0 | 995 |
_e( 'Site registration has been disabled.' ); |
9 | 996 |
} |
0 | 997 |
break; |
998 |
case 'gimmeanotherblog': |
|
999 |
validate_another_blog_signup(); |
|
1000 |
break; |
|
1001 |
case 'default': |
|
9 | 1002 |
default: |
1003 |
$user_email = isset( $_POST['user_email'] ) ? $_POST['user_email'] : ''; |
|
0 | 1004 |
/** |
1005 |
* Fires when the site sign-up form is sent. |
|
1006 |
* |
|
1007 |
* @since 3.0.0 |
|
1008 |
*/ |
|
1009 |
do_action( 'preprocess_signup_form' ); |
|
9 | 1010 |
if ( is_user_logged_in() && ( 'all' === $active_signup || 'blog' === $active_signup ) ) { |
1011 |
signup_another_blog( $newblogname ); |
|
1012 |
} elseif ( ! is_user_logged_in() && ( 'all' === $active_signup || 'user' === $active_signup ) ) { |
|
0 | 1013 |
signup_user( $newblogname, $user_email ); |
9 | 1014 |
} elseif ( ! is_user_logged_in() && ( 'blog' === $active_signup ) ) { |
0 | 1015 |
_e( 'Sorry, new registrations are not allowed at this time.' ); |
9 | 1016 |
} else { |
0 | 1017 |
_e( 'You are logged in already. No need to register again!' ); |
9 | 1018 |
} |
0 | 1019 |
|
1020 |
if ( $newblogname ) { |
|
1021 |
$newblog = get_blogaddress_by_name( $newblogname ); |
|
1022 |
||
9 | 1023 |
if ( 'blog' === $active_signup || 'all' === $active_signup ) { |
1024 |
printf( |
|
16 | 1025 |
/* translators: %s: Site address. */ |
18 | 1026 |
'<p>' . __( 'The site you were looking for, %s, does not exist, but you can create it now!' ) . '</p>', |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1027 |
'<strong>' . $newblog . '</strong>' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1028 |
); |
9 | 1029 |
} else { |
1030 |
printf( |
|
16 | 1031 |
/* translators: %s: Site address. */ |
18 | 1032 |
'<p>' . __( 'The site you were looking for, %s, does not exist.' ) . '</p>', |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1033 |
'<strong>' . $newblog . '</strong>' |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
1034 |
); |
9 | 1035 |
} |
0 | 1036 |
} |
1037 |
break; |
|
1038 |
} |
|
1039 |
} |
|
1040 |
?> |
|
1041 |
</div> |
|
1042 |
</div> |
|
1043 |
<?php |
|
1044 |
/** |
|
1045 |
* Fires after the sign-up forms, before wp_footer. |
|
1046 |
* |
|
1047 |
* @since 3.0.0 |
|
1048 |
*/ |
|
9 | 1049 |
do_action( 'after_signup_form' ); |
1050 |
?> |
|
0 | 1051 |
|
9 | 1052 |
<?php |
1053 |
get_footer( 'wp-signup' ); |