diff --git a/dropins/object-cache.php b/dropins/object-cache.php index 006b515..9eef471 100644 --- a/dropins/object-cache.php +++ b/dropins/object-cache.php @@ -287,9 +287,8 @@ function wp_cache_add_non_persistent_groups($groups) $wp_object_cache->add_non_persistent_groups($groups); } - - if (defined('WP_CLI') && WP_CLI) { - \WP_CLI::add_command('redis', WP_Redis_CLI_Commands::class); - } - endif; + +if (defined('WP_CLI') && WP_CLI && class_exists('WP_Redis_CLI_Commands')) { + \WP_CLI::add_command('redis', WP_Redis_CLI_Commands::class); +}