Ticket #36009: 36009.2.diff
File 36009.2.diff, 2.3 KB (added by , 8 years ago) |
---|
-
src/wp-includes/pluggable.php
1691 1691 * @since 2.0.0 1692 1692 * @since 4.3.0 The `$plaintext_pass` parameter was changed to `$notify`. 1693 1693 * @since 4.3.1 The `$plaintext_pass` parameter was deprecated. `$notify` added as a third parameter. 1694 * @since 4.6.0 The `$notify` parameter accepts 'user' for sending notification only to the user created. 1694 1695 * 1695 1696 * @global wpdb $wpdb WordPress database object for queries. 1696 1697 * @global PasswordHash $wp_hasher Portable PHP password hashing framework instance. … … 1698 1699 * @param int $user_id User ID. 1699 1700 * @param null $deprecated Not used (argument deprecated). 1700 1701 * @param string $notify Optional. Type of notification that should happen. Accepts 'admin' or an empty 1701 * string (admin only), or 'both' (admin and user). Default empty.1702 * string (admin only), 'user', or 'both' (admin and user). Default empty. 1702 1703 */ 1703 1704 function wp_new_user_notification( $user_id, $deprecated = null, $notify = '' ) { 1704 1705 if ( $deprecated !== null ) { … … 1712 1713 // we want to reverse this for the plain text arena of emails. 1713 1714 $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES); 1714 1715 1715 $message = sprintf(__('New user registration on your site %s:'), $blogname) . "\r\n\r\n"; 1716 $message .= sprintf(__('Username: %s'), $user->user_login) . "\r\n\r\n"; 1717 $message .= sprintf(__('Email: %s'), $user->user_email) . "\r\n"; 1716 if ( 'user' !== $notify ) { 1717 $message = sprintf( __( 'New user registration on your site %s:' ), $blogname ) . "\r\n\r\n"; 1718 $message .= sprintf( __( 'Username: %s' ), $user->user_login ) . "\r\n\r\n"; 1719 $message .= sprintf( __( 'Email: %s' ), $user->user_email ) . "\r\n"; 1718 1720 1719 @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message); 1721 @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] New User Registration' ), $blogname ), $message ); 1722 } 1720 1723 1721 1724 // `$deprecated was pre-4.3 `$plaintext_pass`. An empty `$plaintext_pass` didn't sent a user notifcation. 1722 1725 if ( 'admin' === $notify || ( empty( $deprecated ) && empty( $notify ) ) ) {