From 318b496f40e729475f3a808f300c88effc785189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Colombaro?= Date: Tue, 11 Dec 2018 12:45:09 +0100 Subject: [PATCH] Update object-cache.php --- dropins/object-cache.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); +}