Ticket #22187: 22187-docblocks.2.diff
File 22187-docblocks.2.diff, 6.9 KB (added by , 12 years ago) |
---|
-
wp-signup.php
12 12 die(); 13 13 } 14 14 15 /** 16 * Prints signup_header via wp_head 17 * 18 * @since 3.0.0 19 */ 15 20 function do_signup_header() { 16 21 do_action( 'signup_header' ); 17 22 } … … 30 35 // Fix for page title 31 36 $wp_query->is_404 = false; 32 37 38 /** 39 * Prints styles for front-end Multisite signup pages 40 * 41 * @since 3.0.0 42 */ 33 43 function wpmu_signup_stylesheet() { 34 44 ?> 35 45 <style type="text/css"> … … 58 68 <div id="content" class="widecolumn"> 59 69 <div class="mu_register"> 60 70 <?php 71 /** 72 * Generates and displays the Signup and Create Site forms 73 * 74 * @since 3.0.0 75 * 76 * @param string $blogname The new site name 77 * @param string $blog_title The new site title 78 * @param array $errors 79 */ 61 80 function show_blog_form($blogname = '', $blog_title = '', $errors = '') { 62 81 global $current_site; 63 82 // Blog name … … 112 131 do_action('signup_blogform', $errors); 113 132 } 114 133 134 /** 135 * Validate the new site signup 136 * 137 * @since 3.0.0 138 * 139 * @uses wp_get_current_user() to retrieve the current user 140 * @uses wpmu_validate_blog_signup() to validate new site signup for the current user 141 * @return array Contains the new site data and error messages. 142 */ 115 143 function validate_blog_form() { 116 144 $user = ''; 117 145 if ( is_user_logged_in() ) … … 120 148 return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user); 121 149 } 122 150 151 /** 152 * Display user registration form 153 * 154 * @since 3.0.0 155 * 156 * @param string $user_name The entered username 157 * @param string $user_email The entered email address 158 * @param array $errors 159 */ 123 160 function show_user_form($user_name = '', $user_email = '', $errors = '') { 124 161 // User name 125 162 echo '<label for="user_name">' . __('Username:') . '</label>'; … … 142 179 do_action( 'signup_extra_fields', $errors ); 143 180 } 144 181 182 /** 183 * Validate user signup name and email 184 * 185 * @since 3.0.0 186 * 187 * @uses wpmu_validate_user_signup() to retrieve an array of user data 188 * @return array Contains username, email, and error messages. 189 */ 145 190 function validate_user_form() { 146 191 return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); 147 192 } 148 193 194 /** 195 * Allow returning users to sign up for another site 196 * 197 * @since 3.0.0 198 * 199 * @uses wp_get_current_user() to get the current user 200 * @param string $blogname The new site name 201 * @param string $blog_title The new blog title 202 * @param array $errors 203 */ 149 204 function signup_another_blog($blogname = '', $blog_title = '', $errors = '') { 150 205 global $current_site; 151 206 $current_user = wp_get_current_user(); … … 191 246 <?php 192 247 } 193 248 249 /** 250 * Validate a new blog signup 251 * 252 * @since 3.0.0 253 * 254 * @uses wp_get_current_user() to retrieve the current user 255 * @uses wpmu_create_blog() to add a new site 256 * @uses confirm_another_blog_signup() to confirm the user's new site signup 257 * @return bool True if blog signup was validated, False if error 258 */ 194 259 function validate_another_blog_signup() { 195 260 global $wpdb, $blogname, $blog_title, $errors, $domain, $path; 196 261 $current_user = wp_get_current_user(); … … 214 279 return true; 215 280 } 216 281 282 /** 283 * Confirm a new site signup 284 * 285 * @since 3.0.0 286 * 287 * @param string $domain The domain URL 288 * @param string $path The site root path 289 * @param string $user_name The username 290 * @param string $user_email The user's email address 291 * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup() 292 */ 217 293 function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') { 218 294 ?> 219 295 <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2> … … 224 300 do_action( 'signup_finished' ); 225 301 } 226 302 303 /** 304 * Setup the new user signup process 305 * 306 * @since 3.0.0 307 * 308 * @uses apply_filters() filter $filtered_results 309 * @uses show_user_form() to display the user registration form 310 * @param string $user_name The username 311 * @param string $user_email The user's email 312 * @param array $errors 313 */ 227 314 function signup_user($user_name = '', $user_email = '', $errors = '') { 228 315 global $current_site, $active_signup; 229 316 … … 265 352 <?php 266 353 } 267 354 355 /** 356 * Validate the new user signup 357 * 358 * @since 3.0.0 359 * 360 * @uses validate_user_form() to retrieve an array of the user data 361 * @uses wpmu_signup_user() to signup the new user 362 * @uses confirm_user_signup() to confirm the new user signup 363 * @return bool True if new user signup was validated, False if error 364 */ 268 365 function validate_user_signup() { 269 366 $result = validate_user_form(); 270 367 extract($result); … … 285 382 return true; 286 383 } 287 384 385 /** 386 * New user signup confirmation 387 * 388 * @since 3.0.0 389 * 390 * @param string $user_name The username 391 * @param string $user_email The user's email address 392 */ 288 393 function confirm_user_signup($user_name, $user_email) { 289 394 ?> 290 395 <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2> … … 295 400 do_action( 'signup_finished' ); 296 401 } 297 402 403 /** 404 * Setup the new site signup 405 * 406 * @since 3.0.0 407 * 408 * @uses apply_filters() to filter $filtered_results 409 * @uses show_blog_form() to display the blog signup form 410 * @param string $user_name The username 411 * @param string $user_email The user's email address 412 * @param string $blogname The site name 413 * @param string $blog_title The site title 414 * @param array $errors 415 */ 298 416 function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') { 299 417 if ( !is_wp_error($errors) ) 300 418 $errors = new WP_Error(); … … 321 439 <?php 322 440 } 323 441 442 /** 443 * Validate new site signup 444 * 445 * @since 3.0.0 446 * 447 * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors 448 * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors 449 * @uses apply_filters() to make signup $meta filterable 450 * @uses signup_user() to signup a new user 451 * @uses signup_blog() to signup a the new user to a new site 452 * @return bool True of the site signup was validated, False if error 453 */ 324 454 function validate_blog_signup() { 325 455 // Re-validate user info. 326 456 $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); … … 348 478 return true; 349 479 } 350 480 481 /** 482 * New site signup confirmation 483 * 484 * @since 3.0.0 485 * 486 * @param string $domain The domain URL 487 * @param string $path The site root path 488 * @param string $blog_title The new site title 489 * @param string $user_name The user's username 490 * @param string $user_email The user's email address 491 * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup() 492 */ 351 493 function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) { 352 494 ?> 353 495 <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>