Since WPLANG is deprecated in Wordpress 4, what do you use to set a user selected language? In versions 3.x.x I used define('WPLANG', $lang) to set a language and then on the pages could get it using get_locale(). I need to use this approach to differentiate the content for the different languages. I know that it's possible to change the language in Settings->General but I need to do that programmatically.
Thanks
With WordPress 4.0 the define WPLANG
from wp-config.php
is - as you have mentioned - depreciated. It has been replaced by an option called WPLANG
stored in the table <TablePrefix>_options
.
You could use get_option()
to access it:
$my = get_option('WPLANG','en_US');
More details about the change can be found here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With