hooks - Change Password Confirmed Email Text

admin2025-01-08  3

I've been struggling to find a hook I can use to edit the text in the password confirmed email that gets sent out when you've changed your password in WordPress.

Is there anyway to do this with a simple hook that I can add to the child themes functions?

Any help would be appreciated.

I've been struggling to find a hook I can use to edit the text in the password confirmed email that gets sent out when you've changed your password in WordPress.

Is there anyway to do this with a simple hook that I can add to the child themes functions?

Any help would be appreciated.

Share Improve this question edited Sep 25, 2019 at 12:42 butlerblog 5,0713 gold badges26 silver badges42 bronze badges asked Sep 12, 2019 at 8:08 DemonixDemonix 613 silver badges12 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Use like this.

add_filter( 'password_change_email', 'wpse207879_change_password_mail_message', 10, 3 );
function wpse207879_change_password_mail_message( $pass_change_mail, $user, $userdata ) {
  $new_message_txt = __( 'Some text ###USERNAME### more text
      even more text ###EMAIL### more text after more text
      last bit of text ###SITENAME###' );
  $pass_change_mail[ 'message' ] = $new_message_txt;
  return $pass_change_mail;
}

Reference of the above code is: Change Password notification text on mail

This filter is in the wp_update_user() function and is documented here.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736269825a1381.html

最新回复(0)