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: http://core.svn.wordpress.org/trunk@22838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2012-11-26 03:39:29 +00:00
parent bfce253d49
commit 262ee531cb
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'] ) ) if ( isset( $args['screen'] ) )
$args['screen'] = convert_to_screen( $args['screen'] ); $args['screen'] = convert_to_screen( $args['screen'] );
else elseif ( isset( $GLOBALS['hook_suffix'] ) )
$args['screen'] = get_current_screen(); $args['screen'] = get_current_screen();
else
$args['screen'] = null;
return new $class( $args ); return new $class( $args );
} }