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

Leave a Comment
This following error will occur in wordpress theme, When you added function name in wordpress action hook or filter hook, but you forget to define that function in your functions.php file.  Then it will throughs the following error.
Warning : call_user_func_array() expects parameter 1 to be a valid callback, function 'muni' not found or invalid function name

For example I am going to define a filter to set html content type for the mail I am going to send to the user.

add_filter( 'wp_mail_content_type', 'set_html_content_type' );

Where in the wp_mail_content_type filter I had set to call set_html_content_type() callbak function, to set html content type for the email I am going to send. But where I forget to define that function means, it will through above error.

So define that function like this below.

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

0 comments:

Post a comment