From 74b485be95aa25a398d1d91f2f99328c422ff043 Mon Sep 17 00:00:00 2001 From: Toby Schrapel Date: Fri, 19 May 2017 16:22:23 -0500 Subject: [PATCH] Do not redirect for WP-CLI (#1891) --- resources/functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/functions.php b/resources/functions.php index a92aa27..137a026 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -86,6 +86,9 @@ add_filter('stylesheet_directory_uri', function ($uri) { }); if ($sage_views !== get_option('stylesheet')) { update_option('stylesheet', $sage_views); + if (php_sapi_name() === 'cli') { + return; + } wp_redirect($_SERVER['REQUEST_URI']); exit(); }