Wordpress set mail type to html

//Create function which will return content type

function set_html_content_type() {
     return 'text/html';
 }

//now add filter before wp-mail()

Continue reading WordPress set mail type to html

Advertisements

Wordpress bypass sanitize filter for post insert

I found solution for wordpress 3.6 and just want to share here
filter had to be unset due to security problems with it. You could try doing kses_remove_filters() before inserting the post and kses_init_filters() after inserting the post if you are trying to avoid the kses filtering of the post fields. Just be wary since that defeats most of the security measures for inserting posts.

kses_remove_filters(); // remove filter
wp_insert_post($args); //insert post
kses_init_filters(); // put back filter