Hi, I need a little bit of help changing some code in wordpress wp-login. I don't know php at all, but I've been managing to make minor replacements and changes as needed by finding specific text and changing it. I have the register-plus plugin uploaded and it is customized so that when people get their confirmation email it is from me and the subject is my own custom subject. I want to do the same thing for the two "lost your password" emails, but their is no plugin for these. I've located the portion of the code that needs to be changed and I also know which part of the code has the message body in it to edit. I'm not sure which represents the from field for the email, or the subject field. I beleive that this line $title = sprintf(__('[%s] Password Reset'), $blogname); is in reference to the subject, but I'm not sure what I can take out to make it right. Right now the subject shows up as [Pro Illusion] Passord Reset, and I want to get rid of the brackets around my blog title and just type my own subject line. I haven't located the from field code at all, so help with both these things is much appreciated. Below are the two codes for the two emails.
Need help with a simple line of php in wordpress
7
Hi, I need a little bit of help changing some code in wordpress wp-login. I don't know php at all, but I've been managing to make minor replacements and changes as needed by finding specific text and changing it. I have the register-plus plugin uploaded and it is customized so that when people get their confirmation email it is from me and the subject is my own custom subject. I want to do the same thing for the two "lost your password" emails, but their is no plugin for these. I've located the portion of the code that needs to be changed and I also know which part of the code has the message body in it to edit. I'm not sure which represents the from field for the email, or the subject field.
I beleive that this line $title = sprintf(__('[%s] Password Reset'), $blogname); is in reference to the subject, but I'm not sure what I can take out to make it right. Right now the subject shows up as [Pro Illusion] Passord Reset, and I want to get rid of the brackets around my blog title and just type my own subject line. I haven't located the from field code at all, so help with both these things is much appreciated. Below are the two codes for the two emails.
Thanks in advance for your help.
wp_set_password($new_pass, $user->ID);
update_usermeta($user->ID, 'default_password_nag', true); //Set up the Password change nag.
$message = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
$message .= site_url('wp-login.php', 'login') . "\r\n";
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$title = sprintf(__('[%s] Your new password'), $blogname);
$title = apply_filters('password_reset_title', $title);
$message = apply_filters('password_reset_message', $message, $new_pass);
if ( $message && !wp_mail($user->user_email, $title, $message) )
die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
wp_password_change_notification($user);
return true;
}
The other email is
}
$message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
$message .= get_option('siteurl') . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
$message .= site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$title = sprintf(__('[%s] Password Reset'), $blogname);
$title = apply_filters('retrieve_password_title', $title);
$message = apply_filters('retrieve_password_message', $message, $key);
if ( $message && !wp_mail($user_email, $title, $message) )
die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
return true;
I beleive that this line $title = sprintf(__('[%s] Password Reset'), $blogname); is in reference to the subject, but I'm not sure what I can take out to make it right. Right now the subject shows up as [Pro Illusion] Passord Reset, and I want to get rid of the brackets around my blog title and just type my own subject line. I haven't located the from field code at all, so help with both these things is much appreciated. Below are the two codes for the two emails.
Thanks in advance for your help.
wp_set_password($new_pass, $user->ID);
update_usermeta($user->ID, 'default_password_nag', true); //Set up the Password change nag.
$message = sprintf(__('Username: %s'), $user->user_login) . "\r\n";
$message .= sprintf(__('Password: %s'), $new_pass) . "\r\n";
$message .= site_url('wp-login.php', 'login') . "\r\n";
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$title = sprintf(__('[%s] Your new password'), $blogname);
$title = apply_filters('password_reset_title', $title);
$message = apply_filters('password_reset_message', $message, $new_pass);
if ( $message && !wp_mail($user->user_email, $title, $message) )
die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
wp_password_change_notification($user);
return true;
}
The other email is
}
$message = __('Someone has asked to reset the password for the following site and username.') . "\r\n\r\n";
$message .= get_option('siteurl') . "\r\n\r\n";
$message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
$message .= __('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.') . "\r\n\r\n";
$message .= site_url("wp-login.php?action=rp&key=$key&login=" . rawurlencode($user_login), 'login') . "\r\n";
// The blogname option is escaped with esc_html on the way into the database in sanitize_option
// we want to reverse this for the plain text arena of emails.
$blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
$title = sprintf(__('[%s] Password Reset'), $blogname);
$title = apply_filters('retrieve_password_title', $title);
$message = apply_filters('retrieve_password_message', $message, $key);
if ( $message && !wp_mail($user_email, $title, $message) )
die('<p>' . __('The e-mail could not be sent.') . "<br />\n" . __('Possible reason: your host may have disabled the mail() function...') . '</p>');
return true;
- imarketstuff
- [ 1 ] Thanks
- Bruce Hearder
- [ 1 ] Thanks
- Jacob Kettner
- [1] reply
- imarketstuff
- [ 1 ] Thanks
- Jacob Kettner
Next Topics on Trending Feed
-
7