Jeff very nice work on the plugin.
I was able to get different login for different languages.
I also got the notification extension. I was able to place custom categories for the custom notifications.
I was wondering if i could trigger a custom notification label based on language
this the code
// login in Arabic
// pll identify language for poly lang pluin
function tml_action_url_login( $url, $action, $instance ) {
if(pll_current_language() == “ar”) {
if(‘login’ == $action)
$url = ‘/ar/login-2/’;
}
return $url;
}
add_filter( ‘tml_get_action_url’, ‘tml_action_url_login’, 10, 3 );
function tml_action_url_register( $url, $action, $instance ) {
if(pll_current_language() == “ar”) {
if(‘register’ == $action)
$url = ‘/ar/register-2/’;
}
return $url;
}
add_filter( ‘tml_get_action_url’, ‘tml_action_url_register’, 10, 3 );
function tml_action_url_lost( $url, $action, $instance ) {
if(pll_current_language() == “ar”) {
if(‘lostpassword’ == $action)
$url = ‘/ar/lostpassword-2/’;
}
return $url;
}
add_filter( ‘tml_get_action_url’, ‘tml_action_url_lost’, 10, 3 );
function tml_action_url_resetpass( $url, $action, $instance ) {
if(pll_current_language() == “ar”) {
if(‘resetpass’ == $action)
$url = ‘/ar/resetpass-2/’;
}
return $url;
}
add_filter( ‘tml_get_action_url’, ‘tml_action_url_resetpass’, 10, 3 );
function parse_request_callback( $wp ) {
if ( ‘ar/login-2’ == trim( $wp->request, ‘/’ ) ) {
$wp->set_query_var( ‘action’, ‘login’ );
} elseif ( ‘ar/register-2’ == trim( $wp->request, ‘/’ ) ) {
$wp->set_query_var( ‘action’, ‘register’ );
} elseif ( ‘ar/lostpassword-2’ == trim( $wp->request, ‘/’ ) ) {
$wp->set_query_var( ‘action’, ‘lostpassword’ );
}
}
add_action( ‘parse_request’, ‘parse_request_callback’ );
//Labels for custom notification
function register_custom_tml_notification_triggers() {
tml_notifications_register_trigger( ‘Arabic Reset Password’, array(
‘label’ => __( ‘Arabic Reset Password’, ‘theme-my-login-notifications’ ),
) );
tml_notifications_register_trigger( ‘English Reset Password’, array(
‘label’ => __( ‘English Reset Password’, ‘theme-my-login-notifications’ ),
) );
}
add_action( ‘init’, ‘register_custom_tml_notification_triggers’ );