add fallback when get_current_screen returns null.

This commit is contained in:
David Remer 2020-09-11 10:17:03 +03:00
parent 021d1395d0
commit 806c211e35

View file

@ -174,6 +174,9 @@ class WcGatewayModule implements ModuleInterface {
$dcc_applies = $container->get( 'api.helpers.dccapplies' );
$screen = ! function_exists( 'get_current_screen' ) ? (object) array( 'id' => 'front' ) : get_current_screen();
if (! $screen) {
$screen = (object) array( 'id' => 'front' );
}
/**
* The DCC Applies object.
*