Commit f854feed authored by Michael Ochmann's avatar Michael Ochmann
Browse files

added login/logout redirects

parent 28dd7c8b
......@@ -16,6 +16,8 @@ class Theme {
spl_autoload_register([&$this, "autoload"]);
add_action("wp_enqueue_scripts", [&$this, "scripts"]);
add_action("after_setup_theme", [&$this, "setup"]);
add_action("wp_logout", [&$this, "logout"]);
add_filter("login_redirect", [&$this, "login"]);
add_theme_support("post-thumbnails");
add_theme_support("title-tag");
......@@ -48,6 +50,17 @@ class Theme {
wp_enqueue_style('dashicons');
}
public function login() {
if(isset($_REQUEST["redirect_to"]))
return $_REQUEST["redirect_to"];
return "index.php";
}
public function logout() {
wp_redirect( home_url() );
exit();
}
/**
* returns the most recent post.
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment