From 384ab3b98809ef7af962fd0b89204d3d005b06fe Mon Sep 17 00:00:00 2001 From: ashubawork <43743394+ashubawork@users.noreply.github.com> Date: Thu, 8 Jul 2021 11:26:35 +0300 Subject: [PATCH] - fixed is_um_screen() function for new a widgets admin area --- includes/admin/class-admin-functions.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/admin/class-admin-functions.php b/includes/admin/class-admin-functions.php index 2796f70b..5d81583b 100644 --- a/includes/admin/class-admin-functions.php +++ b/includes/admin/class-admin-functions.php @@ -44,16 +44,18 @@ if ( ! class_exists( 'um\admin\Admin_Functions' ) ) { */ function is_um_screen() { global $current_screen; - $screen_id = $current_screen->id; $is_um_screen = false; - if ( strstr( $screen_id, 'ultimatemember') || - strstr( $screen_id, 'um_') || - strstr( $screen_id, 'user' ) || - strstr( $screen_id, 'profile' ) || - $screen_id == 'nav-menus' ) { - $is_um_screen = true; + if ( ! empty( $current_screen ) ) { + $screen_id = $current_screen->id; + if ( strstr( $screen_id, 'ultimatemember' ) || + strstr( $screen_id, 'um_' ) || + strstr( $screen_id, 'user' ) || + strstr( $screen_id, 'profile' ) || + $screen_id == 'nav-menus' ) { + $is_um_screen = true; + } } if ( $this->is_plugin_post_type() ) {