[wp-trac] [WordPress Trac] #54998: Fatal error using admin_email_check_interval filter on PHP 8.0

WordPress Trac noreply at wordpress.org
Sun Jan 30 13:50:12 UTC 2022


#54998: Fatal error using admin_email_check_interval filter on PHP 8.0
------------------------------------+-----------------------------
 Reporter:  josklever               |      Owner:  (none)
     Type:  defect (bug)            |     Status:  new
 Priority:  normal                  |  Milestone:  Awaiting Review
Component:  Login and Registration  |    Version:  5.9
 Severity:  minor                   |   Keywords:
  Focuses:                          |
------------------------------------+-----------------------------
 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 307
 }}}

 A few other filters in the same plugin (removed for testing) don’t give
 any issues, so it’s this specific filter.

 **Workaround**:
 I’ve found another reference on a site for this filter using:

 {{{
 add_filter( 'admin_email_check_interval', '__return_false' );
 }}}

 and that seems to work, although that’s not what the documentation
 suggests on
 https://developer.wordpress.org/reference/hooks/admin_email_check_interval/

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54998>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list