Skip to content

Commit f3a5ef8

Browse files
committed
Add null check for get_current_screen() in metabox enqueue
1 parent 756044a commit f3a5ef8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

includes/admin/class-metabox.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,10 @@ public static function admin_enqueue_scripts() {
477477
}
478478

479479
$screen = get_current_screen();
480+
if ( null === $screen ) {
481+
return;
482+
}
483+
480484
if ( 'post' === $screen->base ) {
481485
wp_enqueue_script(
482486
'crp-admin-metabox',

0 commit comments

Comments
 (0)