Skip to content

Commit bbe73bb

Browse files
committed
fix: use defined('WP_CLI') guard instead of class_exists() to prevent fatal error in web requests
1 parent 3563c9d commit bbe73bb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

inc/functions/helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function wu_get_function_caller(int $depth = 1): ?string {
269269
*/
270270
function wu_cli_is_plugin_skipped($plugin = null): bool {
271271

272-
if ( ! class_exists(\WP_CLI::class)) {
272+
if ( ! defined('WP_CLI') || ! WP_CLI) {
273273
return false;
274274
}
275275

0 commit comments

Comments
 (0)