Make WordPress Core

Opened 2 years ago

Closed 20 months ago

#56052 closed defect (bug) (duplicate)

Creating an instance of WP_List_Table during add_settings_field execution results in hook_sufix not being set.

Reported by: catalinsendsms's profile catalinsendsms Owned by:
Milestone: Priority: normal
Severity: minor Version: 6.0
Component: Plugins Keywords: needs-patch
Focuses: Cc:


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

Change History (1)

#1 @dd32
20 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #49089.

Hi @catalinsendsms,

I apologise for the delay in any response to your ticket, I've just found it while working on another, so I'm marking this as duplicate of that.

Thanks for reporting it!

Note: See TracTickets for help on using tickets.