Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'set_html_content_type' not found or invalid function name Wordpress

Leave a Comment
when you set mail type to html in wordpress using wordpress filter wp_mail_content_type. You may get the following error.

 Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'set_html_content_type' not found or invalid function name

add_filter( 'wp_mail_content_type', 'set_html_content_type' ); 
where we set to call set_html_content_type() function, but you may forget define that function in your functions.php file. So please declare set_html_content_type() function in your functions.php file.

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


0 comments:

Post a Comment