Ticket #25381: 25381.diff
File 25381.diff, 5.5 KB (added by , 11 years ago) |
---|
-
src/wp-signup.php
232 232 $errors = new WP_Error(); 233 233 } 234 234 235 $signup_defaults = array(236 'blogname' => $blogname,237 'blog_title' => $blog_title,238 'errors' => $errors239 );240 241 235 /** 242 236 * Filter the default site sign-up variables. 243 237 * … … 251 245 * @type array $errors An array possibly containing 'blogname' or 'blog_title' errors. 252 246 * } 253 247 */ 254 $filtered_results = apply_filters( 'signup_another_blog_init', $signup_defaults ); 248 $filtered_results = apply_filters( 'signup_another_blog_init', array( 249 'blogname' => $blogname, 250 'blog_title' => $blog_title, 251 'errors' => $errors 252 ) ); 255 253 256 254 $blogname = $filtered_results['blogname']; 257 255 $blog_title = $filtered_results['blog_title']; … … 324 322 325 323 $public = (int) $_POST['blog_public']; 326 324 327 $blog_meta_defaults = array(328 'lang_id' => 1,329 'public' => $public330 );331 332 325 /** 333 326 * Filter the new site meta variables. 334 327 * 335 328 * @since MU 336 329 * @deprecated 3.0.0 Use the 'add_signup_meta' filter instead. 337 330 * 338 * @param array $blog_meta_defaults An array of default blog meta variables. 331 * @param array $blog_meta_defaults { 332 * An array of default site meta variables. 333 * 334 * @type int $lang_id The language ID. 335 * @type int|bool $public Whether search engines should be discouraged from indexing 336 * the site. 1 for true, 0 for false. 337 * } 339 338 */ 340 $meta = apply_filters( 'signup_create_blog_meta', $blog_meta_defaults ); 339 $meta = apply_filters( 'signup_create_blog_meta', array( 340 'lang_id' => 1, 341 'public' => $public 342 ) ); 343 341 344 /** 342 345 * Filter the new default site meta variables. 343 346 * … … 346 349 * @param array $meta { 347 350 * An array of default site meta variables. 348 351 * 349 * @type int $lang_id The language ID. 350 * @type int $blog_public Whether search engines should be discouraged from indexing the site. 1 for true, 0 for false. 352 * @type int $lang_id The language ID. 353 * @type int|bool $blog_public Whether search engines should be discouraged from indexing 354 * the site. 1 for true, 0 for false. Default 1|true. 351 355 * } 352 356 */ 353 357 $meta = apply_filters( 'add_signup_meta', $meta ); … … 388 392 * 389 393 * @since MU 390 394 * 391 * @uses apply_filters() filter $filtered_results392 395 * @uses show_user_form() to display the user registration form 393 396 * @param string $user_name The username 394 397 * @param string $user_email The user's email … … 402 405 403 406 $signup_for = isset( $_POST[ 'signup_for' ] ) ? esc_html( $_POST[ 'signup_for' ] ) : 'blog'; 404 407 405 $signup_user_defaults = array(406 'user_name' => $user_name,407 'user_email' => $user_email,408 'errors' => $errors,409 );410 411 408 /** 412 409 * Filter the default user variables used on the user sign-up form. 413 410 * … … 421 418 * @type array $errors An array of possible errors relevant to the sign-up user. 422 419 * } 423 420 */ 424 $filtered_results = apply_filters( 'signup_user_init', $signup_user_defaults ); 421 $filtered_results = apply_filters( 'signup_user_init', array( 422 'user_name' => $user_name, 423 'user_email' => $user_email, 424 'errors' => $errors, 425 ) ); 426 425 427 $user_name = $filtered_results['user_name']; 426 428 $user_email = $filtered_results['user_email']; 427 429 $errors = $filtered_results['errors']; … … 511 513 * 512 514 * @since MU 513 515 * 514 * @uses apply_filters() to filter $filtered_results515 516 * @uses show_blog_form() to display the blog signup form 516 517 * @param string $user_name The username 517 518 * @param string $user_email The user's email address … … 523 524 if ( !is_wp_error($errors) ) 524 525 $errors = new WP_Error(); 525 526 526 $signup_blog_defaults = array(527 'user_name' => $user_name,528 'user_email' => $user_email,529 'blogname' => $blogname,530 'blog_title' => $blog_title,531 'errors' => $errors532 );533 534 527 /** 535 528 * Filter the default site creation variables for the site sign-up form. 536 529 * … … 539 532 * @param array $signup_blog_defaults { 540 533 * An array of default site creation variables. 541 534 * 542 * @type string $user_name The user username.543 * @type string $user_email The user email address.535 * @type string $user_name Username. 536 * @type string $user_email User email address. 544 537 * @type string $blogname The blogname. 545 538 * @type string $blog_title The title of the site. 546 * @type array $errors An array of possible errors relevant to new site creation variables. 539 * @type array $errors An array of possible errors relevant to new site 540 * creation variables. 547 541 * } 548 542 */ 549 $filtered_results = apply_filters( 'signup_blog_init', $signup_blog_defaults ); 543 $filtered_results = apply_filters( 'signup_blog_init', array( 544 'user_name' => $user_name, 545 'user_email' => $user_email, 546 'blogname' => $blogname, 547 'blog_title' => $blog_title, 548 'errors' => $errors 549 ) ); 550 550 551 551 $user_name = $filtered_results['user_name']; 552 552 $user_email = $filtered_results['user_email']; … … 578 578 * 579 579 * @uses wpmu_validate_user_signup() to retrieve an array of the new user data and errors 580 580 * @uses wpmu_validate_blog_signup() to retrieve an array of the new site data and errors 581 * @uses apply_filters() to make signup $meta filterable582 581 * @uses signup_user() to signup a new user 583 582 * @uses signup_blog() to signup a the new user to a new site 584 583 * @return bool True if the site signup was validated, false if error