Ticket #42133: 42133.1.diff
File 42133.1.diff, 3.4 KB (added by , 6 years ago) |
---|
-
src/wp-admin/includes/upgrade.php
diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 85439b430a..32412ef114 100644
a b if ( ! function_exists( 'wp_new_blog_notification' ) ) : 543 543 */ 544 544 function wp_new_blog_notification( $blog_title, $blog_url, $user_id, $password ) { 545 545 $user = new WP_User( $user_id ); 546 $email = $user->user_email; 547 $name = $user->user_login; 546 $username = $user->user_login; 548 547 $login_url = wp_login_url(); 549 /* translators: New site notification email. 1: New site URL, 2: User login, 3: User password or password reset link, 4: Login URL */550 $message = sprintf(551 __(552 'Your new WordPress site has been successfully set up at:553 548 554 %1$s 549 /* translators: New site notification email. Do not translate SITEURL, USERNAME, PASSWORD, LOGINURL: those are placeholders. */ 550 $new_blog_text = __( 'Your new WordPress site has been successfully set up at: 551 552 ###SITEURL### 555 553 556 554 You can log in to the administrator account with the following information: 557 555 558 Username: %2$s559 Password: %3$s560 Log in here: %4$s556 Username: ###USERNAME### 557 Password: ###PASSWORD### 558 Log in here: ###LOGINURL### 561 559 562 560 We hope you enjoy your new site. Thanks! 563 561 564 562 --The WordPress Team 565 563 https://wordpress.org/ 566 ' 567 ), $blog_url, $name, $password, $login_url 564 '); 565 566 $new_blog_email = array( 567 'to' => $user->user_email, 568 /* translators: New site notification email subject. 1: Site name */ 569 'subject' => __( '[%s] New WordPress Site' ), 570 'message' => $new_blog_text, 571 'headers' => '', 572 ); 573 574 /** 575 * Filters the contents of the email sent when the new blog is created. 576 * 577 * @since 5.0 578 * 579 * @param array $new_blog_email { 580 * Used to build wp_mail(). 581 * @type string $to The intended recipients. Add emails in a comma separated string. 582 * @type string $subject The subject of the email. 583 * @type string $message The content of the email. 584 * The following strings have a special meaning and will get replaced dynamically: 585 * - ###SITEURL### The URL of the new created site. 586 * - ###USERNAME### The site administrator's username. 587 * - ###PASSWORD### The site administrator's password. 588 * - ###LOGINURL### The Login URL of the site. 589 * @type string $headers Headers. Add headers in a newline (\r\n) separated string. 590 * } 591 * @param WP_User $user The site administrator object. 592 * @param string $blog_name The site title. 593 * @param string $blog_url The site URL. 594 * @param string $password The site administrator's password. 595 * 596 */ 597 $new_blog_email = apply_filters( 'new_blog_email', $new_blog_email, $user, $blog_title, $blog_url, $password ); 598 599 // Replace placeholders with the data. 600 $new_blog_email['message'] = str_replace( 601 array( 602 '###SITEURL###', 603 '###USERNAME###', 604 '###PASSWORD###', 605 '###LOGINURL###', 606 ), 607 array( 608 $blog_url, 609 $username, 610 $password, 611 $login_url, 612 ), 613 $new_blog_email['message'] 568 614 ); 569 615 570 @wp_mail( $email, __( 'New WordPress Site' ), $message);616 wp_mail( $new_blog_email['to'], sprintf( $new_blog_email['subject'], $blog_title ), $new_blog_email['message'], $new_blog_email['headers'] ); 571 617 } 572 618 endif; 573 619