On this page we’ll explain how to integrate your GeoDirectory with some other plugins that use the WordPress user accounts.
- Introduction
- Redirecting your login
- Redirecting your registration
- Adjust for your particular integration
Introduction
- By default GD will add its own registration and login page.
- But you may want to redirect either the login and/or registration links to other pages, for example because you are using a membershipp plugin.
- You can add the following code snippets to your child theme’s functions.php or use the code snippets plugin.
1. Redirecting your login
[php]add_filter(‘geodir_login_url’,’change_geodir_login_url’,10,3);
function change_geodir_login_url($login_url,$args,$gd_page_id){
//change the url to whatever you want.
$login_url = ‘http://your-site.com/my-login-page’;
return $login_url;
}[/php]
2. Redirecting your registration
[php]add_filter(‘geodir_login_url’,’_my_geodir_login_url’,10,3);
function _my_geodir_login_url($login_url,$args,$gd_page_id){
if(isset($args[‘signup’])){
//change the url to whatever you want.
$login_url = ‘http://your-site.com/my-rego-page’;
}
return $login_url;
}[/php]
3. Adjust for your particular integration
In the code above you’ll see we are redirecting geodir_signup to /wp-login.php
The page it is redirecting to might have to be adjusted for your situation.
WooCommerce
A standard installation of WooCommerce creates a shopper’s account page at /my-account.
You would change the above code to
[php]$login_url = ‘http://your-site.com/my-account’;[/php]
bbPress, s2Member etc
The code above will work to by-pass GD’s registration and login process for all plugins that use the standard WP login, like:
- bbPress
- s2Member