Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Plugin: Quick Langauge Switcher
- * Note, this only sets the site language, if your user has a user-specific language set, it won't change.
- */
- // sv_SE, ja, ko_KR, ar, he_IL
- function kdwan_switch_language( $locale ) {
- if ( isset( $_GET['l'] ) ) {
- return sanitize_key( $_GET['l'] );
- }
- return $locale;
- }
- add_filter( 'locale', 'kdwan_switch_language' );
Add Comment
Please, Sign In to add comment