Ticket #33209: 33209-3.diff
File 33209-3.diff, 5.9 KB (added by , 2 years ago) |
---|
-
wp-admin/includes/schema.php
1188 1188 $site_admins = get_site_option( 'site_admins' ); 1189 1189 } 1190 1190 1191 /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD : those are placeholders. */1191 /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD, RESETLINK: those are placeholders. */ 1192 1192 $welcome_email = __( 1193 1193 'Howdy USERNAME, 1194 1194 … … 1198 1198 You can log in to the administrator account with the following information: 1199 1199 1200 1200 Username: USERNAME 1201 Password: PASSWORD 1201 To set your password, visit the following address: RESETLINK 1202 1202 Log in here: BLOG_URLwp-login.php 1203 1203 1204 1204 We hope you enjoy your new site. Thanks! -
wp-includes/ms-default-filters.php
113 113 114 114 // Whitelist multisite domains for HTTP requests 115 115 add_filter( 'http_request_host_is_external', 'ms_allowed_http_request_hosts', 20, 2 ); 116 117 // Replace PASSWORD token in welcome_email and welcome_user_email for $password 118 add_filter( 'wpmu_replace_password_token', 'wpmu_replace_password_token', 10, 2 ); 119 // Replace RESETLINK token in welcome_email and welcome_user_email for password reset url 120 add_filter( 'wpmu_replace_resetlink_token', 'wpmu_replace_resetlink_token', 10, 2); -
wp-includes/ms-functions.php
1541 1541 1542 1542 $welcome_email = get_site_option( 'welcome_email' ); 1543 1543 if ( $welcome_email == false ) { 1544 /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD : those are placeholders. */1544 /* translators: Do not translate USERNAME, SITE_NAME, BLOG_URL, PASSWORD, RESETLINK: those are placeholders. */ 1545 1545 $welcome_email = __( 1546 1546 'Howdy USERNAME, 1547 1547 … … 1551 1551 You can log in to the administrator account with the following information: 1552 1552 1553 1553 Username: USERNAME 1554 Password: PASSWORD 1554 To set your password, visit the following address: RESETLINK 1555 1555 1556 Log in here: BLOG_URLwp-login.php 1556 1557 1557 1558 We hope you enjoy your new site. Thanks! … … 1566 1567 $welcome_email = str_replace( 'BLOG_TITLE', $title, $welcome_email ); 1567 1568 $welcome_email = str_replace( 'BLOG_URL', $url, $welcome_email ); 1568 1569 $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email ); 1569 $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email ); 1570 1571 /** 1570 $welcome_email = apply_filters_deprecated( 'wpmu_replace_password_token', array($password, $welcome_email), '5.0', null, __("The PASSWORD token in 'Welcome Email' and 'Welcome User Email' New Site Settings (Network Settings) has been deprecated and will be removed in the future. Instead use RESETLINK as token") ); 1571 $welcome_email = apply_filters( 'wpmu_replace_resetlink_token', $user, $welcome_email ); 1572 1573 /** 1572 1574 * Filters the content of the welcome email after site activation. 1573 1575 * 1574 1576 * Content should be formatted for transmission via wp_mail(). … … 1617 1619 return true; 1618 1620 } 1619 1621 1622 /** 1623 * Replace RESETLINK token with reset password url. 1624 * 1625 * Filter {@see 'wpmu_replace_resetlink_token'} 1626 * 1627 * @since 5.0.0 1628 * 1629 * @param $user User object 1630 * @return string password reset link 1631 */ 1632 function wpmu_replace_resetlink_token( $user, $text ) { 1633 $user_login = $user->user_login; 1634 $set_password_key = get_password_reset_key( $user ); 1635 $reset_link = network_site_url( "wp-login.php?action=rp&key=$set_password_key&login=" . rawurlencode( $user_login ), 'login' ); 1636 return str_replace( 'RESETLINK', $reset_link, $text ); 1637 } 1638 1639 /** 1640 * Case-sensitive replace of PASSWORD token from $text with $password. 1641 * 1642 * Filter {@see 'wpmu_replace_password_token'} 1643 * 1644 * @since 5.0.0. 1645 * 1646 * @param string $text 1647 * @param string $password 1648 * @return string with PASSWORD replaced by $password 1649 * 1650 */ 1651 function wpmu_replace_password_token( $password, $text ) { 1652 return str_replace( 'PASSWORD', $password, $text ); 1653 } 1654 1655 1620 1656 /** 1621 1657 * Notify a user that their account activation has been successful. 1622 1658 * … … 1671 1707 $welcome_email = apply_filters( 'update_welcome_user_email', $welcome_email, $user_id, $password, $meta ); 1672 1708 $welcome_email = str_replace( 'SITE_NAME', $current_network->site_name, $welcome_email ); 1673 1709 $welcome_email = str_replace( 'USERNAME', $user->user_login, $welcome_email ); 1674 $welcome_email = str_replace( 'PASSWORD', $password, $welcome_email);1710 $welcome_email = apply_filters_deprecated( 'wpmu_replace_password_token', array($password, $welcome_email), '5.0', null, __("The PASSWORD token in 'Welcome Email' and 'Welcome User Email' New Site Settings (Network Settings) has been deprecated and will be removed in the future. Instead use RESETLINK as token") ); 1675 1711 $welcome_email = str_replace( 'LOGINLINK', wp_login_url(), $welcome_email ); 1676 1677 $admin_email = get_site_option( 'admin_email' ); 1712 $welcome_email = apply_filters( 'wpmu_replace_resetlink_token', $user, $welcome_email ); 1713 1714 $admin_email = get_site_option( 'admin_email' ); 1678 1715 1679 1716 if ( $admin_email == '' ) { 1680 1717 $admin_email = 'support@' . $_SERVER['SERVER_NAME']; … … 2272 2309 if ( ! $text ) { 2273 2310 remove_filter( 'site_option_welcome_user_email', 'welcome_user_msg_filter' ); 2274 2311 2275 /* translators: Do not translate USERNAME, PASSWORD, LOGINLINK, SITE_NAME: those are placeholders. */2312 /* translators: Do not translate USERNAME, PASSWORD, RESETLINK, LOGINLINK, SITE_NAME: those are placeholders. */ 2276 2313 $text = __( 2277 2314 'Howdy USERNAME, 2278 2315 … … 2280 2317 2281 2318 You can log in with the following information: 2282 2319 Username: USERNAME 2283 Password: PASSWORD 2320 Set your password: RESETLINK 2284 2321 LOGINLINK 2285 2322 2286 2323 Thanks!