Skip to content
Snippets Groups Projects
Commit cd51ab56 authored by Marcin Kolanko's avatar Marcin Kolanko
Browse files

Merge branch 'bugfix/get_current_screen_fail' into 'master'

fix: check if get_current_screen is an object

See merge request !27
parents 082da904 f4ce8d68
No related branches found
No related tags found
1 merge request!27fix: check if get_current_screen is an object
Pipeline #180757 passed with warnings with stages
in 1 minute and 27 seconds
## [3.2.3] - 2023-04-06
### Fixed
- fatal error if get_current_screen function return null
## [3.2.2] - 2023-03-03 ## [3.2.2] - 2023-03-03
### Added ### Added
- security nonce in permanent dismissible notice ajax action - security nonce in permanent dismissible notice ajax action
......
...@@ -101,7 +101,9 @@ class Notice ...@@ -101,7 +101,9 @@ class Notice
require_once ABSPATH . '/wp-admin/includes/screen.php'; require_once ABSPATH . '/wp-admin/includes/screen.php';
} }
return \get_current_screen()->is_block_editor(); $screen = \get_current_screen();
return is_object($screen) ? $screen->is_block_editor() : false;
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment