Skip to:
Content
Pages
Categories
Search
Top
Bottom

After successfully registered – Redirect to ” X ” page – MULTILINGUAL


  • dobosalina
    Participant

    @dobosalina

    Hello,

    I have a issue, I want to have a code who works like this:

    If user registered on English version – redirect to custom English registered successfully page
    If user registered on French version – redirect to custom French registered successfully page

    So far I have made this below:

    function bp_redirect($user)
    $redirect_url = “”;

    if (defined(‘ICL_LANGUAGE_CODE’)) {
    switch (ICL_LANGUAGE_CODE) {

    case ‘fr’:
    $redirect_url = “https://mysite.com/fr/enregistrement-avec-succes/”;
    break;

    default:
    $redirect_url = ‘https://mysite.com/registration-successful/”‘;
    break;

    }
    bp_core_redirect($redirect_url);
    }
    return $redirect_url;
    }
    add_action(‘bp_core_signup_user’, ‘bp_redirect’, 100, 1);

    Unfortunately it is not working and I do not know what do do more to make it work.
    Language plugin is WPML the language pages are http://www.mysite.com/fr , http://www.mysite.com/es etc,

    Please help me, I really need this script to be working.

    Thank you so much

Viewing 1 replies (of 1 total)

  • dobosalina
    Participant

    @dobosalina

    This is the code

    
    function bp_redirect($user)
      $redirect_url = "";
    
    if (defined('ICL_LANGUAGE_CODE')) {
        switch (ICL_LANGUAGE_CODE) {
    		
            case 'fr':
                $redirect_url = "https://volunteerteacher.org/fr/enregistrement-avec-succes/";
              break;
    
    		  default:
                  $redirect_url = 'https://volunteerteacher.org/registration-successful/"';
              break;
    		  
    		  
        }
    	bp_core_redirect($redirect_url);
    }
    return $redirect_url;
    }
    add_action('bp_core_signup_user', 'bp_redirect', 100, 1);
    
    
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar