[wp-trac] [WordPress Trac] #56052: Creating an instance of WP_List_Table during add_settings_field execution results in hook_sufix not being set.
WordPress Trac
noreply at wordpress.org
Thu Jun 23 11:00:40 UTC 2022
#56052: Creating an instance of WP_List_Table during add_settings_field execution
results in hook_sufix not being set.
----------------------------+-----------------------------
Reporter: catalinsendsms | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: 6.0
Severity: minor | Keywords: needs-patch
Focuses: |
----------------------------+-----------------------------
These are the steps to reproduce the bug.
Create a plugin
Call add_settings_field during admin_init hook (ofc after calling
register_setting and add_settings_section)
Inside the callback passed to add_settings_field, create an instance of a
class that extends WP_List_Table (do not override the constructor).
Now, randomly, you will get this error in the console when a page is open
(during some wp core ajax request, I was unable to find the source of this
request).
PHP Notice: Undefined index: hook_suffix in /var/www/html/wp-
admin/includes/class-wp-screen.php on line 226
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56052>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list