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.

git-svn-id: https://develop.svn.wordpress.org/trunk@22838 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-26 03:39:29 +00:00
parent 76b8bb8450
commit 99097a2096
1 changed files with 3 additions and 1 deletions

View File

@ -43,8 +43,10 @@ function _get_list_table( $class, $args = array() ) {
if ( isset( $args['screen'] ) )
$args['screen'] = convert_to_screen( $args['screen'] );
else
elseif ( isset( $GLOBALS['hook_suffix'] ) )
$args['screen'] = get_current_screen();
else
$args['screen'] = null;
return new $class( $args );
}