SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | /* | |
3 | Plugin Name: Set Locale | |
4 | Plugin URI: http://yoursite.tld | |
5 | Description: Sets the locale | |
6 | Author: Johannes Pilkahn | |
7 | Version: 1.0 | |
8 | Author URI: http://tramprennen.org | |
9 | */ | |
10 | ||
11 | function sl_current_lang() { | |
12 | $sl_uri = $_SERVER["REQUEST_URI"]; | |
13 | $sl_lang = array_pop( explode( '/', $sl_uri ) ); | |
14 | ||
15 | return $sl_lang; | |
16 | } | |
17 | ||
18 | function sl_set_locale() { | |
19 | - | global $current_user; |
19 | + | |
20 | if( sl_current_lang() == 'en' ) { | |
21 | define( 'WPLANG', 'en_US' ); | |
22 | } else { | |
23 | define( 'WPLANG', 'el_GR' ); | |
24 | } | |
25 | } | |
26 | ||
27 | sl_set_locale(); | |
28 | ||
29 | ?> |