[wp-trac] [WordPress Trac] #52784: Granularize and catch error called on line 292 of wp-includes/class-wp-hook.php

WordPress Trac noreply at wordpress.org
Fri Mar 26 10:21:15 UTC 2021


#52784: Granularize and catch error called on line 292 of wp-includes/class-wp-
hook.php
-------------------------------+-------------------------------
 Reporter:  Laughter On Water  |       Owner:  (none)
     Type:  enhancement        |      Status:  closed
 Priority:  normal             |   Milestone:
Component:  Plugins            |     Version:  5.7
 Severity:  normal             |  Resolution:  duplicate
 Keywords:                     |     Focuses:  coding-standards
-------------------------------+-------------------------------
Description changed by SergeyBiryukov:

Old description:

> Currently, when you're designing a theme or plugin, any malformed
> functions or the malformed hooks that activate them can throw this error:
>
> Warning: call_user_func_array() expects parameter 1 to be a valid
> callback, function '' not found or invalid function name in
> /home/user_name/user.web.site/wp-includes/class-wp-hook.php on line 292
>
> Core is not the cause of the error. My in-development plugin is.
>
> It would be more helpful if this error were caught in such a way that
> theme and plugin designers could be told in the debug.log exactly
> ''which'' line in theme's or plugin's function.php is causing the error.

New description:

 Currently, when you're designing a theme or plugin, any malformed
 functions or the malformed hooks that activate them can throw this error:

 `Warning: call_user_func_array() expects parameter 1 to be a valid
 callback, function '' not found or invalid function name in
 /home/user_name/user.web.site/wp-includes/class-wp-hook.php on line 292`

 Core is not the cause of the error. My in-development plugin is.

 It would be more helpful if this error were caught in such a way that
 theme and plugin designers could be told in the debug.log exactly
 ''which'' line in theme's or plugin's function.php is causing the error.

--

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52784#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list