Ticket #11210: 11210_pluggable.php.adds-hooks.patch
File 11210_pluggable.php.adds-hooks.patch, 2.6 KB (added by , 15 years ago) |
---|
-
pluggable.php
1138 1138 if ( !function_exists('wp_new_user_notification') ) : 1139 1139 /** 1140 1140 * Notify the blog admin of a new user, normally via email. 1141 * Also sends email to new user with plaintext password. 1141 1142 * 1142 1143 * @since 2.0 1144 * @uses apply_filters() Calls 'wp_new_user_notification_admin' hook on an array of all of admin mail parameters. 1145 * @uses apply_filters() Calls 'wp_new_user_notification_user' hook on an array of all of user mail parameters. 1143 1146 * 1144 1147 * @param int $user_id User ID 1145 1148 * @param string $plaintext_pass Optional. The user's plaintext password 1149 * 1146 1150 */ 1147 1151 function wp_new_user_notification($user_id, $plaintext_pass = '') { 1148 1152 $user = new WP_User($user_id); 1149 1153 1150 $user_login = stripslashes( $user->user_login);1151 $user_email = stripslashes( $user->user_email);1154 $user_login = stripslashes( $user->user_login ); 1155 $user_email = stripslashes( $user->user_email ); 1152 1156 1153 $message = sprintf( __('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n";1154 $message .= sprintf( __('Username: %s'), $user_login) . "\r\n\r\n";1155 $message .= sprintf( __('E-mail: %s'), $user_email) . "\r\n";1157 $message = sprintf( __('New user registration on your blog %s:'), get_option( 'blogname' ) ) . "\r\n\r\n"; 1158 $message .= sprintf( __('Username: %s'), $user_login ) . "\r\n\r\n"; 1159 $message .= sprintf( __('E-mail: %s'), $user_email ) . "\r\n"; 1156 1160 1157 @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message); 1161 $subject = sprintf(__('[%s] New User Registration'), get_option('blogname') ); 1162 $to = get_option( 'admin_email' ); 1158 1163 1159 if ( empty($plaintext_pass) ) 1164 $send = true; 1165 extract( apply_filters( 'wp_new_user_notification_admin', compact( 'send', 'to', 'subject', 'message' ) ) ); 1166 1167 if ( $send ) 1168 @wp_mail(get_option('admin_email'), $subject, $message); 1169 1170 if ( empty( $plaintext_pass) ) ) 1160 1171 return; 1161 1172 1162 1173 $message = sprintf(__('Username: %s'), $user_login) . "\r\n"; 1163 1174 $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n"; 1164 1175 $message .= wp_login_url() . "\r\n"; 1165 1176 1166 wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);1177 $subject = sprintf( __('[%s] Your username and password'), get_option( 'blogname' ) ); 1167 1178 1179 $send = true; 1180 extract( apply_filters( 'wp_new_user_notification_user', compact( 'send', 'to', 'subject', 'message' ) ) ); 1181 1182 if ( $send ) 1183 wp_mail($user_email, $subject, $message); 1184 1168 1185 } 1169 1186 endif; 1170 1187