Ticket #25381: wp-signup.diff
File wp-signup.diff, 8.1 KB (added by , 11 years ago) |
---|
-
wp-signup.php
18 18 * @since MU 19 19 */ 20 20 function do_signup_header() { 21 /** 22 * Fires within the <head></head> section of the sign up screen. 23 * 24 * @since 3.0 25 */ 21 26 do_action( 'signup_header' ); 22 27 } 23 28 add_action( 'wp_head', 'do_signup_header' ); … … 63 68 add_action( 'wp_head', 'wpmu_signup_stylesheet' ); 64 69 get_header(); 65 70 71 /** 72 * Fires actions before sign up form on the sign up screen. 73 * 74 * @since 3.0 75 */ 66 76 do_action( 'before_signup_form' ); 67 77 ?> 68 78 <div id="content" class="widecolumn"> … … 79 89 */ 80 90 function show_blog_form($blogname = '', $blog_title = '', $errors = '') { 81 91 global $current_site; 82 // Blog nam e92 // Blog nam e 83 93 if ( !is_subdomain_install() ) 84 94 echo '<label for="blogname">' . __('Site Name:') . '</label>'; 85 95 else … … 128 138 </div> 129 139 130 140 <?php 141 /** 142 * Fires actions after sign up blog form. 143 * 144 * @since 3.0 145 */ 131 146 do_action('signup_blogform', $errors); 132 147 } 133 148 … … 176 191 if ( $errmsg = $errors->get_error_message('generic') ) { 177 192 echo '<p class="error">' . $errmsg . '</p>'; 178 193 } 194 /** 195 * Add extra fields to the user registration form. 196 * 197 * @since 3.0 198 */ 179 199 do_action( 'signup_extra_fields', $errors ); 180 200 } 181 201 … … 209 229 $errors = new WP_Error(); 210 230 } 211 231 212 // allow definition of default variables 232 /** 233 * allow definition of default variables. 234 * 235 * @since 3.0 236 * @param array $blogname, $blog_title, $errors 237 */ 213 238 $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 214 239 $blogname = $filtered_results['blogname']; 215 240 $blog_title = $filtered_results['blog_title']; … … 239 264 <p><?php _e( 'If you’re not going to use a great site domain, leave it for a new user. Now have at it!' ) ?></p> 240 265 <form id="setupform" method="post" action="wp-signup.php"> 241 266 <input type="hidden" name="stage" value="gimmeanotherblog" /> 267 /** 268 * Add extra hidden fields to the form of sign up another blog. 269 * 270 * @since 3.0 271 */ 242 272 <?php do_action( 'signup_hidden_fields' ); ?> 243 273 <?php show_blog_form($blogname, $blog_title, $errors); ?> 244 274 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ) ?>" /></p> … … 271 301 } 272 302 273 303 $public = (int) $_POST['blog_public']; 304 /** 305 * Filter for the new blog meta. 306 * 307 * @since 3.0 308 * @param array $blogname, $blog_title, $errors 309 */ 274 310 $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated 311 /** 312 * Filter for the new blog meta after the signup_create_blog_meta hook. 313 * 314 * @since 3.0 315 * @param array $meta 316 */ 275 317 $meta = apply_filters( 'add_signup_meta', $meta ); 276 318 277 319 wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid ); … … 297 339 <?php printf( __( '<a href="http://%1$s">http://%2$s</a> is your new site. <a href="%3$s">Log in</a> as “%4$s” using your existing password.' ), $domain.$path, $domain.$path, "http://" . $domain.$path . "wp-login.php", $user_name ) ?> 298 340 </p> 299 341 <?php 342 /** 343 * Fires actions when sign up finished. 344 * 345 * @since 3.0 346 */ 300 347 do_action( 'signup_finished' ); 301 348 } 302 349 … … 319 366 320 367 $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog'; 321 368 322 // allow definition of default variables 369 /** 370 * allow definition of default variables for sign up user 371 * 372 * @since 3.0 373 * @param array $user_name, $user_email, $errors 374 */ 323 375 $filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors )); 324 376 $user_name = $filtered_results['user_name']; 325 377 $user_email = $filtered_results['user_email']; … … 330 382 <h2><?php printf( __( 'Get your own %s account in seconds' ), $current_site->site_name ) ?></h2> 331 383 <form id="setupform" method="post" action="wp-signup.php"> 332 384 <input type="hidden" name="stage" value="validate-user-signup" /> 385 /** 386 * Add extra hidden fields to the form of sign up another blog. 387 * 388 * @since 3.0 389 */ 333 390 <?php do_action( 'signup_hidden_fields' ); ?> 334 391 <?php show_user_form($user_name, $user_email, $errors); ?> 335 392 … … 376 433 return false; 377 434 } 378 435 436 /** 437 * Allow definition of default for the meta variables for sign up user 438 * 439 * @since 3.0 440 * @param array $user_name, $user_email, $errors 441 */ 379 442 wpmu_signup_user($user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); 380 443 381 444 confirm_user_signup($user_name, $user_email); … … 397 460 <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p> 398 461 <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p> 399 462 <?php 463 /** 464 * Fires actions when sign up finished. 465 * 466 * @since 3.0 467 */ 400 468 do_action( 'signup_finished' ); 401 469 } 402 470 … … 417 485 if ( !is_wp_error($errors) ) 418 486 $errors = new WP_Error(); 419 487 420 // allow definition of default variables 488 /** 489 * Allow definition of default variablesi for the sign upped blog 490 * 491 * @since 3.0 492 * @param array $user_name, $user_email, $blogname, $blog_title, $errors 493 */ 421 494 $filtered_results = apply_filters('signup_blog_init', array('user_name' => $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 422 495 $user_name = $filtered_results['user_name']; 423 496 $user_email = $filtered_results['user_email']; … … 432 505 <input type="hidden" name="stage" value="validate-blog-signup" /> 433 506 <input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" /> 434 507 <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" /> 508 /** 509 * Add extra hidden fields to the form of sign up another blog. 510 * 511 * @since 3.0 512 */ 435 513 <?php do_action( 'signup_hidden_fields' ); ?> 436 514 <?php show_blog_form($blogname, $blog_title, $errors); ?> 437 515 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Signup') ?>" /></p> … … 471 549 472 550 $public = (int) $_POST['blog_public']; 473 551 $meta = array ('lang_id' => 1, 'public' => $public); 552 /** 553 * Allow definition of default variablesi for the sign upped blog 554 * 555 * @since 3.0 556 * @param array $user_name, $user_email, $blogname, $blog_title, $errors 557 */ 474 558 $meta = apply_filters( 'add_signup_meta', $meta ); 475 559 476 560 wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta); … … 507 591 </ul> 508 592 </p> 509 593 <?php 594 /** 595 * Fires actions when sign up finished. 596 * 597 * @since 3.0 598 */ 510 599 do_action( 'signup_finished' ); 511 600 } 512 601 513 602 // Main 514 603 $active_signup = get_site_option( 'registration', 'none' ); 604 /** 605 * Filter for sign up type. It should return "all", "none", "blog" or "user". 606 * 607 * @since 3.0 608 * @param string $active_signup 609 */ 515 610 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 516 611 517 612 // Make the signup type translatable. … … 552 647 case 'default': 553 648 default : 554 649 $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; 650 /** 651 * Fires actions when sign up form sent. 652 * 653 * @since 3.0 654 */ 555 655 do_action( 'preprocess_signup_form' ); // populate the form from invites, elsewhere? 556 656 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) 557 657 signup_another_blog($newblogname); … … 576 676 ?> 577 677 </div> 578 678 </div> 679 /** 680 * Fires actions after sign up form before wp_footer action. 681 * 682 * @since 3.0 683 */ 579 684 <?php do_action( 'after_signup_form' ); ?> 580 685 581 686 <?php get_footer(); ?>