Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been struggling with a warning message above the comments field on a site I'm building for a friend and I'd be very grateful if you're able to help. I've asked on the Wordpress Codex, but unfortunately there's been no response.

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'tl_spam_free_wordpress_comments_form' was given in /home/euanmitc/public_html/wp-includes/plugin.php on line 405

I've attempted to comment out the offending line in the plugin.php

I have also deactivate all plugins with no success.

You can see an example here: http://euanmitchell.com.au/2012/05/future-education/

The site uses a Thesis theme. Please let me know if you have an ideas for possible solutions.

Best regards,

Les Thomas

share|improve this question
add comment

closed as too localized by toscho Dec 23 '12 at 18:10

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

Given the error message:

Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'tl_spam_free_wordpress_comments_form' was given in /home/euanmitc/public_html/wp-includes/plugin.php on line 403

The error is being generated by whatever Plugin defines this function:

tl_spam_free_wordpress_comments_form()

...which appears to be Spam Free WordPress Comments.

This bit:

First argument is expected to be a valid callback

...generally refers to an add_action() or add_filter() call. For some reason, WordPress doesn't recognize tl_spam_free_wordpress_comments_form() as a valid callback - which means that WordPress isn't finding it as a declared (defined) function.

Do you have the Spam Free Plugin activated?

share|improve this answer
add comment

It's always best to start with the WordPress support forum, or the plugin author's plugin page, with a support question.

If you had mentioned on my plugin support page that the theme being used was Thesis I would have been able to answer your question sooner, rather than stumbling upon your more detailed question here.

Go back and read the plugin page under the section Thesis Theme. It says "Go to Thesis -> Custom File Editor, choose custom_functions.php, then click Edit selected file. Add the following line of code to that file:"

add_action('thesis_hook_comment_field', 'tl_spam_free_wordpress_comments_form');

Building on what Chip said, the error occurred because you deactivated the plugin without removing the add_action line above from the custom_functions.php file first.

share|improve this answer
add comment

I ran into this problem using the Captcha plug-in in conjunction with the Business Directory plug-in on Weaver II theme. My solution, as rough as it is, was to require users to register and be logged in to comment. That seems to eliminate the error without having to edit the programming.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.