Ticket #5789: 5789.02.patch
| File 5789.02.patch, 2.1 KB (added by , 11 years ago) |
|---|
-
src/bp-core/bp-core-filters.php
248 248 * by '[User Set]'. 249 249 */ 250 250 function bp_core_filter_user_welcome_email( $welcome_email ) { 251 252 251 // Don't touch the email when a user is registered by the site admin 253 if ( is_admin() ) 252 if ( is_admin() ) { 254 253 return $welcome_email; 254 } 255 256 // On "Users > Add New" admin page, an admin created a new user. 257 // Let the regular welcome email through, which has the user's password. 258 if ( strpos( bp_get_requested_url(), 'wp-activate.php' ) !== false ) { 259 return $welcome_email; 260 } 255 261 256 262 // Don't touch the email if we don't have a custom registration template 257 if ( ! bp_has_custom_signup_page() ) 263 if ( ! bp_has_custom_signup_page() ) { 258 264 return $welcome_email; 265 } 259 266 260 267 // [User Set] Replaces 'PASSWORD' in welcome email; Represents value set by user 261 268 return str_replace( 'PASSWORD', __( '[User Set]', 'buddypress' ), $welcome_email ); … … 278 285 * @return string Filtered $welcome_email with $password replaced by '[User Set]'. 279 286 */ 280 287 function bp_core_filter_blog_welcome_email( $welcome_email, $blog_id, $user_id, $password ) { 281 282 288 // Don't touch the email when a user is registered by the site admin. 283 if ( is_admin() ) 289 if ( is_admin() ) { 284 290 return $welcome_email; 291 } 285 292 286 293 // Don't touch the email if we don't have a custom registration template 287 if ( ! bp_has_custom_signup_page() ) 294 if ( ! bp_has_custom_signup_page() ) { 288 295 return $welcome_email; 296 } 289 297 290 298 // [User Set] Replaces $password in welcome email; Represents value set by user 291 299 return str_replace( $password, __( '[User Set]', 'buddypress' ), $welcome_email ); … … 350 358 * @return bool True on success, false on failure. 351 359 */ 352 360 function bp_core_activation_signup_user_notification( $user, $user_email, $key, $meta ) { 361 // Don't touch the email when a user is registered by the site admin. 362 if ( is_admin() ) { 363 return $user; 364 } 353 365 354 366 // Set up activation link 355 367 $activate_url = bp_get_activation_page() . "?key=$key";