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:
parent
76b8bb8450
commit
99097a2096
@ -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 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user