Snippets

Dan Bochichio BuddyPress Login / Logout Redirect

Updated by Former user

File bp-login-logout-redirect Added

  • Ignore whitespace
  • Hide word diff
+function custom_login_redirect_to($user_login, $user) {
+	bp_core_redirect( get_option('siteurl') . "/dashboard" );
+}
+add_action('wp_login', 'custom_login_redirect_to', 10, 2);
+
+
+add_action('wp_logout','auto_redirect_after_logout');
+function auto_redirect_after_logout(){
+  wp_redirect( home_url() );
+  exit();
+}

File bp-login-logout-redirect.php Deleted

  • Ignore whitespace
  • Hide word diff
-function custom_login_redirect_to($user_login, $user) {
-	bp_core_redirect( get_option('siteurl') . "/dashboard" );
-}
-add_action('wp_login', 'custom_login_redirect_to', 10, 2);
-
-
-add_action('wp_logout','auto_redirect_after_logout');
-function auto_redirect_after_logout(){
-  wp_redirect( home_url() );
-  exit();
-}
Created by Former user

File bp-login-logout-redirect.php Added

  • Ignore whitespace
  • Hide word diff
+function custom_login_redirect_to($user_login, $user) {
+	bp_core_redirect( get_option('siteurl') . "/dashboard" );
+}
+add_action('wp_login', 'custom_login_redirect_to', 10, 2);
+
+
+add_action('wp_logout','auto_redirect_after_logout');
+function auto_redirect_after_logout(){
+  wp_redirect( home_url() );
+  exit();
+}
HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.