Changeset 4203 for sites/trunk/common/includes/wporg-sso/wp-plugin.php
- Timestamp:
- 10/08/2016 10:51:26 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/common/includes/wporg-sso/wp-plugin.php
r4189 r4203 31 31 32 32 if ( $this->has_host() ) { 33 add_action( 'init', array( &$this, 'redirect_all_login_or_signup_to_sso' ) );33 add_action( 'init', array( $this, 'redirect_all_login_or_signup_to_sso' ) ); 34 34 // De-hooking the password change notification, too high volume on wp.org, for no admin value. 35 35 remove_action( 'after_password_reset', 'wp_password_change_notification' ); 36 } 36 37 add_filter( 'password_change_email', array( $this, 'replace_admin_email_in_change_emails' ) ); 38 add_filter( 'email_change_email', array( $this, 'replace_admin_email_in_change_emails' ) ); 39 } 40 } 41 42 /** 43 * Replaces the admin email placeholder with a support email 44 * to avoid using the site's admin email. 45 * 46 * @param array $email The email/password change email. 47 * @return array The email/password change email. 48 */ 49 public function replace_admin_email_in_change_emails( $email ) { 50 $email['headers'] = "From: WordPress.org <donotreply@wordpress.org>\n"; 51 $email['message'] = str_replace( '###ADMIN_EMAIL###', self::SUPPORT_EMAIL, $email['message'] ); 52 return $email; 37 53 } 38 54 39 55 /** 40 56 * Redirect all attempts to get to a WP login or signup to the SSO ones, or to a safe redirect location. 41 57 * 42 58 * @example add_action( 'init', array( &$wporg_sso, 'redirect_all_wp_login_or_signup_to_sso' ) ); 43 59 *
Note: See TracChangeset
for help on using the changeset viewer.