• RaphaelJeger

    (@raphaeljeger)


    Hi

    I would like to use your plugin for a project of mine.
    Since I already know the language of each visitor by a plugin I developed, I would like to switch the rest of the site (around my plugin) to this language.

    Is there any way I can tell your programm programmatically which language to show? I’m already setting the “locale” in WP so my plugin shows the correct language so I’d prefer if your plugin could be adapted to use this as well.

    I don’t mind to put a few lines of code if you think that’s a good idea.

    Thanks!
    Raphael

    https://wordpress.org/plugins/polylang/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chouby

    (@chouby)

    Hi!

    I am not sure to understand. Maybe you want to control the preferred language at first visit to the home page. In that case, the filter pll_preferred_language should be what you are looking for.

    Thread Starter RaphaelJeger

    (@raphaeljeger)

    Ok that may work, thanks!
    I just want to set the language programmatically, as I already know which language the user wants from “outside of WP”.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set language programmatically’ is closed to new replies.