Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#22570 closed defect (bug) (fixed)

_get_list_table() should account for the lack of a screen for ajax

Reported by: nacin Owned by: nacin
Milestone: 3.5 Priority: low
Severity: normal Version:
Component: General Keywords: has-patch commit dev-reviewed
Focuses: Cc:



If 'screen' is not passed, _get_list_table() will call get_current_screen(), which might trip over hook_suffix not being set, for plugin-initiated ajax requests. We could do a quick check for elseif ( isset( $GLOBALS['hook_suffix'] ) ) to avoid the notice. Better to not pass a screen than an improper or broken one.

Attachments (1)

22570.diff (537 bytes) - added by nacin 3 years ago.

Download all attachments as: .zip

Change History (4)

3 years ago

#1 @ryan
3 years ago

Looks good.

#2 @nacin
3 years ago

  • Keywords has-patch commit dev-reviewed added

#3 @nacin
3 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 22838:

Only pass the current screen to the list table constructor when we have a screen to work with. This is not the case for admin-ajax requests. fixes #22570.

Note: See TracTickets for help on using tickets.