Skip to content

Commit

Permalink
Fix redirect loop
Browse files Browse the repository at this point in the history
  • Loading branch information
retlehs committed Apr 4, 2017
1 parent c3e6f13 commit 5ac56aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@
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();
}

0 comments on commit 5ac56aa

Please sign in to comment.