Skip to content

Commit 7ac7b5b

Browse files
author
Jon Waldstein
committed
fix: require WP_Screen if missing
1 parent 5c1302f commit 7ac7b5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ValueObjects/ScreenCondition.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ private function validateCondition($condition)
4949
static $wpScreenProperties = null;
5050

5151
if ($wpScreenProperties === null) {
52+
if (! class_exists('WP_Screen')) {
53+
require_once ABSPATH . 'wp-admin/includes/screen.php';
54+
}
55+
5256
$wpScreenProperties = get_class_vars('WP_Screen');
5357
}
5458

0 commit comments

Comments
 (0)