Ticket #25381: wp-signup.3.diff
File wp-signup.3.diff, 8.7 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.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 before sign up form on the sign up screen. 73 * 74 * @since 3.0.0 75 */ 66 76 do_action( 'before_signup_form' ); 67 77 ?> 68 78 <div id="content" class="widecolumn"> … … 128 138 </div> 129 139 130 140 <?php 141 /** 142 * Fires after sign up blog form. 143 * 144 * @since 3.0.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.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 213 $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 232 $signup_defaults = array( 233 'blogname' => $blogname, 234 'blog_title' => $blog_title, 235 'errors' => $errors 236 ); 237 238 /** 239 * Filter default site signup variables. 240 * 241 * @since 3.0.0 242 * @param array $signup_defaults An array of default site signup variables. 243 */ 244 $filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults ); 214 245 $blogname = $filtered_results['blogname']; 215 246 $blog_title = $filtered_results['blog_title']; 216 247 $errors = $filtered_results['errors']; … … 239 270 <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 271 <form id="setupform" method="post" action="wp-signup.php"> 241 272 <input type="hidden" name="stage" value="gimmeanotherblog" /> 273 /** 274 * Add extra hidden fields to the form of sign up another blog. 275 * 276 * @since 3.0.0 277 */ 242 278 <?php do_action( 'signup_hidden_fields' ); ?> 243 279 <?php show_blog_form($blogname, $blog_title, $errors); ?> 244 280 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e( 'Create Site' ) ?>" /></p> … … 271 307 } 272 308 273 309 $public = (int) $_POST['blog_public']; 274 $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated 310 311 $blog_meta_defaults = array( 312 'lang_id' => 1, 313 'public' => $public 314 ); 315 316 /** 317 * Filter the new blog meta variables. 318 * 319 * @since 3.0.0 320 * @param array $blog_meta_defaults An array of default blog meta variables. 321 */ 322 $meta = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults ); // deprecated 323 /** 324 * Filter the new blog meta after the signup_create_blog_meta hook. 325 * 326 * @since 3.0.0 327 * @param array $meta An array of default blog meta variables. 328 */ 275 329 $meta = apply_filters( 'add_signup_meta', $meta ); 276 330 277 331 wpmu_create_blog( $domain, $path, $blog_title, $current_user->ID, $meta, $wpdb->siteid ); … … 297 351 <?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 352 </p> 299 353 <?php 354 /** 355 * Fires when sign up finished. 356 * 357 * @since 3.0.0 358 */ 300 359 do_action( 'signup_finished' ); 301 360 } 302 361 … … 319 378 320 379 $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog'; 321 380 322 // allow definition of default variables 323 $filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors )); 381 $signup_user_default = array( 382 'user_name' => $user_name, 383 'user_email' => $user_email, 384 'errors' => $errors, 385 ); 386 387 /** 388 * Filter defaut user variables. 389 * 390 * @since 3.0.0 391 * @param array $signup_user_default An array of defaut user variables. 392 */ 393 $filtered_results = apply_filters( 'signup_user_init', $signup_user_default ); 324 394 $user_name = $filtered_results['user_name']; 325 395 $user_email = $filtered_results['user_email']; 326 396 $errors = $filtered_results['errors']; … … 330 400 <h2><?php printf( __( 'Get your own %s account in seconds' ), $current_site->site_name ) ?></h2> 331 401 <form id="setupform" method="post" action="wp-signup.php"> 332 402 <input type="hidden" name="stage" value="validate-user-signup" /> 403 /** 404 * Add extra hidden fields to the form of sign up another blog. 405 * 406 * @since 3.0.0 407 */ 333 408 <?php do_action( 'signup_hidden_fields' ); ?> 334 409 <?php show_user_form($user_name, $user_email, $errors); ?> 335 410 … … 376 451 return false; 377 452 } 378 453 379 wpmu_signup_user($user_name, $user_email, apply_filters( 'add_signup_meta', array() ));454 $optional_signup_meta = array(); 380 455 456 /** 457 * Filter the optional sign up meta variables. 458 * 459 * @since 3.0.0 460 * @param array $optional_signup_meta An array of optional signup meta variables. 461 */ 462 $meta = apply_filters( 'add_signup_meta', $optional_signup_meta ); 463 464 wpmu_signup_user($user_name, $user_email, $meta ); 465 381 466 confirm_user_signup($user_name, $user_email); 382 467 return true; 383 468 } … … 397 482 <p><?php printf( __( 'Check your inbox at <strong>%s</strong> and click the link given.' ), $user_email ); ?></p> 398 483 <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p> 399 484 <?php 485 /** 486 * Fires when sign up finished. 487 * 488 * @since 3.0.0 489 */ 400 490 do_action( 'signup_finished' ); 401 491 } 402 492 … … 417 507 if ( !is_wp_error($errors) ) 418 508 $errors = new WP_Error(); 419 509 420 // allow definition of default variables 421 $filtered_results = apply_filters('signup_blog_init', array('user_name' => $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 510 $signup_blog_default = array( 511 'user_name' => $user_name, 512 'user_email' => $user_email, 513 'blogname' => $blogname, 514 'blog_title' => $blog_title, 515 'errors' => $error 516 ); 517 518 /** 519 * Filter default blog signup variables. 520 * 521 * @since 3.0.0 522 * @param array $signup_blog_default An array of default blog signup variables. 523 */ 524 $filtered_results = apply_filters( 'signup_blog_init', $signup_blog_default ); 422 525 $user_name = $filtered_results['user_name']; 423 526 $user_email = $filtered_results['user_email']; 424 527 $blogname = $filtered_results['blogname']; … … 432 535 <input type="hidden" name="stage" value="validate-blog-signup" /> 433 536 <input type="hidden" name="user_name" value="<?php echo esc_attr($user_name) ?>" /> 434 537 <input type="hidden" name="user_email" value="<?php echo esc_attr($user_email) ?>" /> 538 /** 539 * Add extra hidden fields to the form of sign up another blog. 540 * 541 * @since 3.0.0 542 */ 435 543 <?php do_action( 'signup_hidden_fields' ); ?> 436 544 <?php show_blog_form($blogname, $blog_title, $errors); ?> 437 545 <p class="submit"><input type="submit" name="submit" class="submit" value="<?php esc_attr_e('Signup') ?>" /></p> … … 471 579 472 580 $public = (int) $_POST['blog_public']; 473 581 $meta = array ('lang_id' => 1, 'public' => $public); 582 583 /** 584 * Filter the new blog meta variables. 585 * 586 * @since 3.0.0 587 * @param array $meta An array of default blog meta variables. 588 */ 474 589 $meta = apply_filters( 'add_signup_meta', $meta ); 475 590 476 591 wpmu_signup_blog($domain, $path, $blog_title, $user_name, $user_email, $meta); … … 507 622 </ul> 508 623 </p> 509 624 <?php 625 /** 626 * Fires when sign up finished. 627 * 628 * @since 3.0.0 629 */ 510 630 do_action( 'signup_finished' ); 511 631 } 512 632 513 633 // Main 514 634 $active_signup = get_site_option( 'registration', 'none' ); 635 /** 636 * Filter for sign up type. It should return "all", "none", "blog" or "user". 637 * 638 * @since 3.0.0 639 * @param string $active_signup An string of sign up type. 640 */ 515 641 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 516 642 517 643 // Make the signup type translatable. … … 552 678 case 'default': 553 679 default : 554 680 $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; 681 /** 682 * Fires when sign up form sent. 683 * 684 * @since 3.0.0 685 */ 555 686 do_action( 'preprocess_signup_form' ); // populate the form from invites, elsewhere? 556 687 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) 557 688 signup_another_blog($newblogname); … … 576 707 ?> 577 708 </div> 578 709 </div> 710 /** 711 * Fires after sign up form before wp_footer action. 712 * 713 * @since 3.0.0 714 */ 579 715 <?php do_action( 'after_signup_form' ); ?> 580 716 581 717 <?php get_footer(); ?>