From cbe7732afa2c1737b42b0f1bfb9562891dd13f69 Mon Sep 17 00:00:00 2001 From: Antoine M Date: Fri, 26 Jan 2024 10:36:23 +0100 Subject: [PATCH] switching from /demo components to /tutorial with fallback --- includes/rooting.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/rooting.php b/includes/rooting.php index d054d2c..41415df 100644 --- a/includes/rooting.php +++ b/includes/rooting.php @@ -17,13 +17,17 @@ add_action('template_redirect', 'redirect_to_demo_components_page'); function redirect_to_demo_components_page() { // if ($_SERVER['REQUEST_URI'] == '/demo-components' && is_user_logged_in()) { - if ($_SERVER['REQUEST_URI'] == '/demo-components') { + if ($_SERVER['REQUEST_URI'] == '/tutorial') { global $wp_query; $wp_query->is_404 = false; status_header(200); include(dirname(__DIR__, 1) . '/demo-components.php'); exit(); } + if ($_SERVER['REQUEST_URI'] == '/demo-components') { + wp_redirect('/tutorial'); + exit(); + } if ($_SERVER['REQUEST_URI'] == '/sitemap-progress') { global $wp_query; $wp_query->is_404 = false;