WordPress使用自定义wp_mail
函数,因此如果要搜索邮件,则无法找到它。你应该找到retrieve_password_message
在那里进行筛选调用。这是返回重置密码消息内容的筛选器。
// Change the message/body of the email
add_filter( \'retrieve_password_message\', \'rv_new_retrieve_password_message\', 10, 4 );
function rv_new_retrieve_password_message( $message, $key, $user_login, $user_data ){
/**
* Assemble the URL for resetting the password
* see line 330 of wp-login.php for parameters
*/
$reset_url = add_query_arg( array(
\'action\' => \'rp\',
\'key\' => $key,
\'login\' => rawurlencode( $user_login )
), wp_login_url() );
ob_start();
printf( \'<p>%s</p>\', __( \'Hi, \' ) . $user_fname );
printf( \'<p>%s</p>\', __( \'It looks like you need to reset your password on the site. If this is correct, simply click the link below. If you were not the one responsible for this request, ignore this email and nothing will happen.\' ) );
printf( \'<p><a href="%s">%s</a></p>\', $reset_url, __( \'Reset Your Password\' ) );
$message = ob_get_clean();
return $message;
}
在wp登录中,您可以找到检索密码的函数。
/**
177 * Handles sending password retrieval email to user.
178 *
179 * @uses $wpdb WordPress Database object
180 *
181 * @return bool|WP_Error True: when finish. WP_Error on error
182 */
183 function retrieve_password() {}
我建议您不要编辑WordPress的核心文件,请在函数中使用挂钩/过滤器。php文件。我希望这对你有帮助。