Changeset 25645
- Timestamp:
- 09/28/2013 11:41:07 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-signup.php
r25616 r25645 19 19 */ 20 20 function do_signup_header() { 21 /** 22 * Fires within the <head> section of the site sign-up screen. 23 * 24 * @since 3.0.0 25 */ 21 26 do_action( 'signup_header' ); 22 27 } … … 64 69 get_header(); 65 70 71 /** 72 * Fires before the site sign-up form. 73 * 74 * @since 3.0.0 75 */ 66 76 do_action( 'before_signup_form' ); 67 77 ?> … … 129 139 130 140 <?php 131 do_action('signup_blogform', $errors); 141 /** 142 * Fires after the site sign-up form. 143 * 144 * @since 3.0.0 145 * 146 * @param array $errors An array possibly containing 'blogname' or 'blog_title' errors. 147 */ 148 do_action( 'signup_blogform', $errors ); 132 149 } 133 150 … … 177 194 echo '<p class="error">' . $errmsg . '</p>'; 178 195 } 196 /** 197 * Fires at the end of the user registration form on the site sign-up form. 198 * 199 * @since 3.0.0 200 * 201 * @param array $errors An array possibly containing 'user_name' or 'user_email' errors. 202 */ 179 203 do_action( 'signup_extra_fields', $errors ); 180 204 } … … 210 234 } 211 235 212 // allow definition of default variables 213 $filtered_results = apply_filters('signup_another_blog_init', array('blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 236 $signup_defaults = array( 237 'blogname' => $blogname, 238 'blog_title' => $blog_title, 239 'errors' => $errors 240 ); 241 242 /** 243 * Filter the default site sign-up variables. 244 * 245 * @since 3.0.0 246 * 247 * @param array $signup_defaults { 248 * An array of default site sign-up variables. 249 * 250 * @type string $blogname The site blogname. 251 * @type string $blog_title The site title. 252 * @type array $errors An array possibly containing 'blogname' or 'blog_title' errors. 253 * } 254 */ 255 $filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults ); 256 214 257 $blogname = $filtered_results['blogname']; 215 258 $blog_title = $filtered_results['blog_title']; … … 242 285 <?php 243 286 /** 244 * Hidden sign up form fields output for creating another site.287 * Hidden sign-up form fields output when creating another site or user. 245 288 * 246 289 * @since MU 247 290 * 248 * @param string $context A string describing the step of the signup process. the value can be291 * @param string $context A string describing the steps of the sign-up process. The value can be 249 292 * 'create-another-site', 'validate-user', or 'validate-site'. 250 293 */ … … 282 325 283 326 $public = (int) $_POST['blog_public']; 284 $meta = apply_filters( 'signup_create_blog_meta', array( 'lang_id' => 1, 'public' => $public ) ); // deprecated 327 328 $blog_meta_defaults = array( 329 'lang_id' => 1, 330 'public' => $public 331 ); 332 333 /** 334 * Filter the new site meta variables. 335 * 336 * @since MU 337 * @deprecated 3.0.0 Use the 'add_signup_meta' filter instead. 338 * 339 * @param array $blog_meta_defaults An array of default blog meta variables. 340 */ 341 $meta = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults ); 342 /** 343 * Filter the new default site meta variables. 344 * 345 * @since 3.0.0 346 * 347 * @param array $meta { 348 * An array of default site meta variables. 349 * 350 * @type int $lang_id The language ID. 351 * @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false. 352 * } 353 */ 285 354 $meta = apply_filters( 'add_signup_meta', $meta ); 286 355 … … 308 377 </p> 309 378 <?php 379 /** 380 * Fires when the site or user sign-up process is complete. 381 * 382 * @since 3.0.0 383 */ 310 384 do_action( 'signup_finished' ); 311 385 } … … 330 404 $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog'; 331 405 332 // allow definition of default variables 333 $filtered_results = apply_filters('signup_user_init', array('user_name' => $user_name, 'user_email' => $user_email, 'errors' => $errors )); 406 $signup_user_defaults = array( 407 'user_name' => $user_name, 408 'user_email' => $user_email, 409 'errors' => $errors, 410 ); 411 412 /** 413 * Filter the default user variables used on the user sign-up form. 414 * 415 * @since 3.0.0 416 * 417 * @param array $signup_user_defaults { 418 * An array of default user variables. 419 * 420 * @type string $user_name The user username. 421 * @type string $user_email The user email address. 422 * @type array $errors An array of possible errors relevant to the sign-up user. 423 * } 424 */ 425 $filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults ); 334 426 $user_name = $filtered_results['user_name']; 335 427 $user_email = $filtered_results['user_email']; … … 390 482 } 391 483 392 wpmu_signup_user($user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); 484 //duplicate_hook 485 wpmu_signup_user( $user_name, $user_email, apply_filters( 'add_signup_meta', array() ) ); 393 486 394 487 confirm_user_signup($user_name, $user_email); … … 411 504 <p><?php _e( 'If you do not activate your username within two days, you will have to sign up again.' ); ?></p> 412 505 <?php 506 //duplicate_hook 413 507 do_action( 'signup_finished' ); 414 508 } … … 431 525 $errors = new WP_Error(); 432 526 433 // allow definition of default variables 434 $filtered_results = apply_filters('signup_blog_init', array('user_name' => $user_name, 'user_email' => $user_email, 'blogname' => $blogname, 'blog_title' => $blog_title, 'errors' => $errors )); 527 $signup_blog_defaults = array( 528 'user_name' => $user_name, 529 'user_email' => $user_email, 530 'blogname' => $blogname, 531 'blog_title' => $blog_title, 532 'errors' => $errors 533 ); 534 535 /** 536 * Filter the default site creation variables for the site sign-up form. 537 * 538 * @since 3.0.0 539 * 540 * @param array $signup_blog_defaults { 541 * An array of default site creation variables. 542 * 543 * @type string $user_name The user username. 544 * @type string $user_email The user email address. 545 * @type string $blogname The blogname. 546 * @type string $blog_title The title of the site. 547 * @type array $errors An array of possible errors relevant to new site creation variables. 548 * } 549 */ 550 $filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults ); 551 435 552 $user_name = $filtered_results['user_name']; 436 553 $user_email = $filtered_results['user_email']; … … 488 605 $public = (int) $_POST['blog_public']; 489 606 $meta = array ('lang_id' => 1, 'public' => $public); 607 608 //duplicate_hook 490 609 $meta = apply_filters( 'add_signup_meta', $meta ); 491 610 … … 524 643 </p> 525 644 <?php 645 //duplicate_hook 526 646 do_action( 'signup_finished' ); 527 647 } … … 529 649 // Main 530 650 $active_signup = get_site_option( 'registration', 'none' ); 531 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user" 651 /** 652 * Filter the type of site sign-up. 653 * 654 * @since 3.0.0 655 * 656 * @param string $active_signup String that returns registration type. The value can be 657 * 'all', 'none', 'blog', or 'user'. 658 */ 659 $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); 532 660 533 661 // Make the signup type translatable. … … 569 697 default : 570 698 $user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : ''; 571 do_action( 'preprocess_signup_form' ); // populate the form from invites, elsewhere? 699 /** 700 * Fires when the site sign-up form is sent. 701 * 702 * @since 3.0.0 703 */ 704 do_action( 'preprocess_signup_form' ); 572 705 if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) ) 573 706 signup_another_blog($newblogname); … … 593 726 </div> 594 727 </div> 595 <?php do_action( 'after_signup_form' ); ?> 728 <?php 729 /** 730 * Fires after the sign-up forms, before wp_footer. 731 * 732 * @since 3.0.0 733 */ 734 do_action( 'after_signup_form' ); ?> 596 735 597 736 <?php get_footer(); ?>
Note: See TracChangeset
for help on using the changeset viewer.