Customizing lost password email

You want the filters… retrieve_password_message for the actual email content. Your hooked function will get the message as the first argument and the user’s reset key as the second. <?php add_filter(‘retrieve_password_message’, ‘wpse103299_reset_msg’, 10, 2); function wpse103299_reset_msg($message, $reset_key) { // … } retrieve_password_title for the the email subject. <?php add_filter(‘retrieve_password_title’, ‘wpse103299_reset_subject’); function wpse103299_reset_subject($subject) { // … … Read more

Email confirmation on registration

I had to implement this for a client site and ended up creating my own system. I hash the email and date created timestamp and store it as a key in usermeta, then i email that key to the user’s email in the form of a link. The link points to a page where I’ve … Read more

Allow Duplicate Email Address for Different Users

Unfortunately, this just isn’t possible. There are three occasions where WordPress performs this check: When you click ‘save’ on the edit user screen( https://github.com/WordPress/WordPress/blob/master/wp-admin/includes/user.php#L157 ) When a user is registered ( https://github.com/WordPress/WordPress/blob/master/wp-includes/user.php#L2023 ) When a user is created/inserted into the dtabase ( https://github.com/WordPress/WordPress/blob/master/wp-includes/user.php#L1610 ) Both (1) and (2) have hooks after them which allow you … Read more

prevent users from changing their email address

The only correct solution (Other answers I see are faulty, vulnerable or incomplete. All of them can be bypassed.) This plugin does correctly: class DisableMailChange { public function __construct() { //prevent email change add_action( ‘personal_options_update’, [$this, ‘disable_mail_change_BACKEND’], 5 ); add_action( ‘show_user_profile’, [$this, ‘disable_mail_change_HTML’] ); } public function disable_mail_change_BACKEND($user_id) { if ( !current_user_can( ‘manage_options’ ) ) … Read more

“Reply-to Address” Email

If and when you are using wp_mail(), then you can just set Reply-To for the $headers parameter. Exemplary usage below: $to = “[email protected]”; $subject = “Using Reply-To with wp_mail”; $message = “This is an example for using Reply-To with wp_mail.”; $headers[] = ‘Reply-To: Name Name <[email protected]>’; $attachments = array(); wp_mail( $to, $subject, $message, $headers, $attachments … Read more

User Without Email?

It’s possible, just no so easily via the Users page without some hackery. The WordPress API will let you insert users without email addresses, so a little custom plugin to accept a login name and password, and a call to wp_insert_user or wp_update_user should work for you. Unfortunately I don’t have time to code it … Read more

Missing URL in password reset email

The problem is the < and > which surround the reset URL in wp-login.php. You can remove them using retrieve_password_message in your theme functions.php file like below: add_filter(“retrieve_password_message”, “mapp_custom_password_reset”, 99, 4); function mapp_custom_password_reset($message, $key, $user_login, $user_data ) { $message = “Someone has requested a password reset for the following account: ” . sprintf(__(‘%s’), $user_data->user_email) . … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)