admin管理员组文章数量:1328002
I have been struggling to remove the wpautop
filter from the retrieve_password_message
function. I created a new email message and want to keep my <br>
s instead of having automatic paragraphs added - since most email clients can't handle well <p>
paddings or margins.
Any help?
I have been struggling to remove the wpautop
filter from the retrieve_password_message
function. I created a new email message and want to keep my <br>
s instead of having automatic paragraphs added - since most email clients can't handle well <p>
paddings or margins.
Any help?
Share Improve this question asked Jul 23, 2020 at 8:10 scooterlordscooterlord 1137 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 0Thanks to the constructive conversation with Jacob in the comments, I did some additional tests and realized that the <p>
tags were in fact added by the plugin - testing in ive environment revealed that the email was plain text.
The solution to the problem was to add the following snippet in my functions.php
:
function email_set_content_type(){
return "text/html";
}
add_filter( 'wp_mail_content_type','email_set_content_type' );
本文标签: emailRemove wpautop from retrievepasswordmessage
版权声明:本文标题:email - Remove wpautop from retrieve_password_message 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742239266a2438654.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
wpautop
is not applied toretrieve_password_message
. In fact, the password reset email does not even appear to be an HTML email, so HTML tags wouldn't even work. – Jacob Peattie Commented Jul 23, 2020 at 8:48wpautop()
? I know, but where is it applied to the password reset email? – Jacob Peattie Commented Jul 23, 2020 at 9:29