Ticket #22187: 22187-docblocks.diff
File 22187-docblocks.diff, 7.0 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 * The default styles are printed via signup_header which is hooked to wp_head. 42 * They can be overloaded by replacing the output on the signup_header action hook. 43 * 44 * @since 3.0.0 45 */ 33 46 function wpmu_signup_stylesheet() { 34 47 ?> 35 48 <style type="text/css"> … … 58 71 <div id="content" class="widecolumn"> 59 72 <div class="mu_register"> 60 73 <?php 74 /** 75 * Generates and displays the Signup and Create Site forms 76 * 77 * @since 3.0.0 78 * 79 * @param string $blogname The new site name 80 * @param string $blog_title The new site title 81 * @param array $errors 82 */ 61 83 function show_blog_form($blogname = '', $blog_title = '', $errors = '') { 62 84 global $current_site; 63 85 // Blog name … … 112 134 do_action('signup_blogform', $errors); 113 135 } 114 136 137 /** 138 * Validate the new site signup 139 * 140 * @since 3.0.0 141 * 142 * @uses wp_get_current_user() to retrieve the current user 143 * @uses wpmu_validate_blog_signup() to validate new site signup for the current user 144 * @return array Contains the new site data and error messages. 145 */ 115 146 function validate_blog_form() { 116 147 $user = ''; 117 148 if ( is_user_logged_in() ) … … 120 151 return wpmu_validate_blog_signup($_POST['blogname'], $_POST['blog_title'], $user); 121 152 } 122 153 154 /** 155 * Display user registration form 156 * 157 * @since 3.0.0 158 * 159 * @param string $user_name The entered username 160 * @param string $user_email The entered email address 161 * @param array $errors 162 */ 123 163 function show_user_form($user_name = '', $user_email = '', $errors = '') { 124 164 // User name 125 165 echo '<label for="user_name">' . __('Username:') . '</label>'; … … 142 182 do_action( 'signup_extra_fields', $errors ); 143 183 } 144 184 185 /** 186 * Validate user signup name and email 187 * 188 * @since 3.0.0 189 * 190 * @uses wpmu_validate_user_signup() to retrieve an array of user data 191 * @return array Contains username, email, and error messages. 192 */ 145 193 function validate_user_form() { 146 194 return wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); 147 195 } 148 196 197 /** 198 * Allow returning users to sign up for another site 199 * 200 * @since 3.0.0 201 * 202 * @uses wp_get_current_user() to get the current user 203 * @param string $blogname The new site name 204 * @param string $blog_title The new blog title 205 * @param array $errors 206 */ 149 207 function signup_another_blog($blogname = '', $blog_title = '', $errors = '') { 150 208 global $current_site; 151 209 $current_user = wp_get_current_user(); … … 191 249 <?php 192 250 } 193 251 252 /** 253 * Validate a new blog signup 254 * 255 * @since 3.0.0 256 * 257 * @uses wp_get_current_user() to retrieve the current user 258 * @uses wpmu_create_blog() to add a new site 259 * @uses confirm_another_blog_signup() to confirm the user's new site signup 260 * @return bool True if blog signup was validated, False if error 261 */ 194 262 function validate_another_blog_signup() { 195 263 global $wpdb, $blogname, $blog_title, $errors, $domain, $path; 196 264 $current_user = wp_get_current_user(); … … 214 282 return true; 215 283 } 216 284 285 /** 286 * Confirm a new site signup 287 * 288 * @since 3.0.0 289 * 290 * @param string $domain The domain URL 291 * @param string $path The site root path 292 * @param string $user_name The username 293 * @param string $user_email The user's email address 294 * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup() 295 */ 217 296 function confirm_another_blog_signup($domain, $path, $blog_title, $user_name, $user_email = '', $meta = '') { 218 297 ?> 219 298 <h2><?php printf( __( 'The site %s is yours.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2> … … 224 303 do_action( 'signup_finished' ); 225 304 } 226 305 306 /** 307 * Setup the new user signup process 308 * 309 * @since 3.0.0 310 * 311 * @uses apply_filters() filter $filtered_results 312 * @uses show_user_form() to display the user registration form 313 * @param string $user_name The username 314 * @param string $user_email The user's email 315 * @param array $errors 316 */ 227 317 function signup_user($user_name = '', $user_email = '', $errors = '') { 228 318 global $current_site, $active_signup; 229 319 … … 265 355 <?php 266 356 } 267 357 358 /** 359 * Validate the new user signup 360 * 361 * @since 3.0.0 362 * 363 * @uses validate_user_form() to retrieve an array of the user data 364 * @uses wpmu_signup_user() to signup the new user 365 * @uses confirm_user_signup() to confirm the new user signup 366 * @return bool True if new user signup was validated, False if error 367 */ 268 368 function validate_user_signup() { 269 369 $result = validate_user_form(); 270 370 extract($result); … … 285 385 return true; 286 386 } 287 387 388 /** 389 * New user signup confirmation 390 * 391 * @since 3.0.0 392 * 393 * @param string $user_name The username 394 * @param string $user_email The user's email address 395 */ 288 396 function confirm_user_signup($user_name, $user_email) { 289 397 ?> 290 398 <h2><?php printf( __( '%s is your new username' ), $user_name) ?></h2> … … 295 403 do_action( 'signup_finished' ); 296 404 } 297 405 406 /** 407 * Setup the new site signup 408 * 409 * @since 3.0.0 410 * 411 * @uses apply_filters() to filter $filtered_results 412 * @uses show_blog_form() to display the blog signup form 413 * @param string $user_name The username 414 * @param string $user_email The user's email address 415 * @param string $blogname The site name 416 * @param string $blog_title The site title 417 * @param array $errors 418 */ 298 419 function signup_blog($user_name = '', $user_email = '', $blogname = '', $blog_title = '', $errors = '') { 299 420 if ( !is_wp_error($errors) ) 300 421 $errors = new WP_Error(); … … 321 442 <?php 322 443 } 323 444 445 /** 446 * Validate new site signup 447 * 448 * @since 3.0.0 449 * 450 * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors 451 * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors 452 * @uses apply_filters() to make signup $meta filterable 453 * @uses signup_user() to signup a new user 454 * @uses signup_blog() to signup a the new user to a new site 455 * @return bool True of the site signup was validated, False if error 456 */ 324 457 function validate_blog_signup() { 325 458 // Re-validate user info. 326 459 $result = wpmu_validate_user_signup($_POST['user_name'], $_POST['user_email']); … … 348 481 return true; 349 482 } 350 483 484 /** 485 * New site signup confirmation 486 * 487 * @since 3.0.0 488 * 489 * @param string $domain The domain URL 490 * @param string $path The site root path 491 * @param string $blog_title The new site title 492 * @param string $user_name The user's username 493 * @param string $user_email The user's email address 494 * @param string $meta Any additional meta from the 'add_signup_meta' filter in validate_blog_signup() 495 */ 351 496 function confirm_blog_signup($domain, $path, $blog_title, $user_name = '', $user_email = '', $meta) { 352 497 ?> 353 498 <h2><?php printf( __( 'Congratulations! Your new site, %s, is almost ready.' ), "<a href='http://{$domain}{$path}'>{$blog_title}</a>" ) ?></h2>