Dealer/Distributor – Login Redirect Official

Need to pass login name or email to the this redirect page.

PHP Widget for actual code under Appearance –> Widgets

PHP code here to redirect based on Country. Country ID is 13

Get User Role and Country from database for country

basic premise:

if user role == “Dealer” and Dealer == approved {
if Canada %country_do13% then URL = Canada Price page

{
else US Price for all var fields = NonCan Price page}}

or error “please contact support”

Site Title:
%site_title%

Users profile page
https://greentronics.com/wp-admin/users.php

URL Canada:
%urlcan%

User field Canada:

URL USA:
%urlusa%

Logout URL:
Logout URL
%logout_url%

User Login:
%user_login%

user url Profile Page?:
[user_url]

ID below:
%ID%

Site URL below:
%site_url%

Meta Key below:
%your_meta_key%

Admin URL:
%admin_url%

add_filter(‘get_the_permalink’,’my_permalink_redirect’);
function my_permalink_redirect($permalink) {
global $post;
if ($post->ID == your_post_id_here) {
$permalink = ‘http://new-url.com/pagename’;
}
return $permalink;
}