From f8541091b619ce39582edff8ce42c64ec854e7f8 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Wed, 14 Oct 2015 00:56:43 +1100 Subject: [PATCH] Prevent error when no screen object --- includes/admin/class-sp-admin-menus.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/admin/class-sp-admin-menus.php b/includes/admin/class-sp-admin-menus.php index 0620662a..e008f146 100755 --- a/includes/admin/class-sp-admin-menus.php +++ b/includes/admin/class-sp-admin-menus.php @@ -77,6 +77,7 @@ class SP_Admin_Menus { public function menu_highlight() { global $typenow; $screen = get_current_screen(); + if ( ! is_object( $screen ) ) return; if ( $screen->id == 'sp_role' ) { $this->highlight_admin_menu( 'edit.php?post_type=sp_staff', 'edit-tags.php?taxonomy=sp_role&post_type=sp_staff' ); } elseif ( is_sp_config_type( $typenow ) ) {