Custom Login Redirects

If you would like to add redirects after login or logout you can use the following filters:

Requirements: 

  1. AppPresser plugin 3.3.0+
  2. Redirect must be a page in your app menu

Login Redirect to a URL
Using the page slug from your WordPress page

The my_appp_login_redirect function only needs to return a full URL. If you the  get_site_url function you can use the just page slug by just replacing 'my-page-slug' is the slug of your post or page.

function my_appp_login_redirect() {
	return get_site_url( null, 'my-page-slug'); // page slug from your WordPress page
}
add_filter( 'appp_login_redirect', 'my_appp_login_redirect' );

Login Redirect to an App Page
Using the page slug from your app's custom page.

function my_appp_login_redirect() {
	return array(
		'title' => 'About Us',
		'url' => 'about-us', // page slug from your app's custom page
		'navigate' => 'root' // 'root' or 'forward'
	);
}
add_filter( 'appp_login_redirect', 'my_appp_login_redirect' );

Logout Redirect to a URL
Using the page slug from your WordPress page

function my_appp_logout_redirect() {
	return get_site_url( null, 'my-page-slug'); // page slug from your WordPress page
}
add_filter( 'appp_logout_redirect', 'my_appp_logout_redirect' );

Logout Redirect to an App Page
Using the page slug from your app's custom page.

function my_appp_logout_redirect() {
	return array(
		'title' => 'Have a Nice Day',
		'url'   => 'have-a-nice-day', // page slug from your app's custom page
		'navigate' => 'root' // 'root' or 'forward'
	);
}
add_filter( 'appp_logout_redirect', 'my_appp_logout_redirect' );

You can add this code to /wp-content/mu-plugins/appp-login-redirect.php.

Facebook Login Redirects (AppPresser 3 Only)

Want to use login redirects after the Facebook login with our AppFBConnect plugin? You can have a separate login redirect than the one you set with the methods above. Also, you can redirect new users to a completely different URL as well.  Works with WordPress page slug or your app's custom pages too.

Gotchas

Be sure when using a full URL that you use https:// for your site, otherwise, you will be redirected to a page that does not have your WordPress authentication cookies and you will get logged out.