From 5ac56aadf2f00f8ba30ade31f0c4bdf9bc69d878 Mon Sep 17 00:00:00 2001 From: Ben Word Date: Mon, 3 Apr 2017 18:49:09 -0600 Subject: [PATCH] Fix redirect loop --- functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions.php b/functions.php index 07e0b40..3329747 100644 --- a/functions.php +++ b/functions.php @@ -80,8 +80,8 @@ if (is_customize_preview() && isset($_GET['theme'])) { add_filter('template', function ($stylesheet) { return dirname(dirname($stylesheet)); }); -if (basename($stylesheet = get_option('template')) !== 'resources/views') { - update_option('template', "{$stylesheet}/resources/views"); +if (($sage_views = basename(__DIR__).'/resources/views') !== get_option('template')) { + update_option('template', $sage_views); wp_redirect($_SERVER['REQUEST_URI']); exit(); }