thebrandonallen/wp-fail2ban-redux

Enabling filters generates PHP warnings

Closed this issue · 1 comments

I created a custom plugin with the following add_filter entries:

add_filter( 'wp_fail2ban_redux_block_user_enumeration', '_return_true' );
add_filter( 'wp_fail2ban_redux_log_pingbacks', '_return_true' );
add_filter( 'wp_fail2ban_redux_log_spam_comments', '_return_true' );

And now I'm seeing hundreds of these entries in my debug.log:

[27-Sep-2017 06:07:07 UTC] PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function '_return_true' not found or invalid function name in /var/www/mysite.com/wp-includes/class-wp-hook.php on line 298

Sorry about that. I just realized the examples on the Wiki are wrong. It should be __return_true, instead of _return_true. Note that the correct version uses two leading underscores. I'll get the Wiki fixed.