add_filter issue with PHP 8
-
I’m debugging an issue while logging in on a site running on PHP 8.0 (no issues on 7.4) and I’ve managed to isolate it to a single function call I’m using to disable admin e-mail verification messages during login.
Setup:
- WordPress 5.9 (same with 5.8.x)
- No plugins
- Default theme Twenty Twenty (same with other themes)
- mu-plugin with just 1 filter
- PHP 8.0.15 (same with older 8.0.x versions)
Single line of code in wp-content/mu-plugins/my-mu-plugin.php:
add_filter( 'admin_email_check_interval', 0 );Error when logging in:
Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, no array or string given in /.../wp-includes/class-wp-hook.php:307 Stack trace: #0 /.../wp-includes/plugin.php(189): WP_Hook->apply_filters() #1 /.../wp-login.php(1282): apply_filters() #2 {main} thrown in /.../wp-includes/class-wp-hook.php on line 307A few other filters in the same plugin (removed for testing) don’t give any issues, so it’s this specific filter.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘add_filter issue with PHP 8’ is closed to new replies.