Title: Trouble with plugin development
Last modified: August 20, 2016

---

# Trouble with plugin development

 *  [Lee Wallis](https://wordpress.org/support/users/fatwombat/)
 * (@fatwombat)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-plugin-development/)
 * Hey, I have this code:
 *     ```
       add_action('plugins_loaded', 'check_language');
   
       function check_language(){
   
       	$userid = wp_get_current_user()->ID;
   
       	if(substr($_SERVER['REQUEST_URI'], 0, 6) == '/lang/'){
       		switch(substr($_SERVER['REQUEST_URI'], 6, 2)){
   
       			case 'en' : $language = 'english'; break;
       			case 'fr' : $language = 'french'; break;
       			default : $language = 'english'; break;
   
       		}
   
       		update_user_meta( $userid, 'language', $language );
       	}
   
       }
       ```
   
 * Now it’s in the plugin, but, it only ever stores french in the DB, can anyone
   see why this is? I am pulling my hair out cause I am surely missing something
   stupid.
 * I have 2 pages under the parent of ‘language’ which are english and french. The
   URLS are:
    english: /lang/en/ french: /lang/fr/
 * Thanks in advance.

Viewing 1 replies (of 1 total)

 *  Thread Starter [Lee Wallis](https://wordpress.org/support/users/fatwombat/)
 * (@fatwombat)
 * [14 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-plugin-development/#post-2147476)
 * Anyone have any ideas?

Viewing 1 replies (of 1 total)

The topic ‘Trouble with plugin development’ is closed to new replies.

## Tags

 * [language](https://wordpress.org/support/topic-tag/language/)
 * [update_user_meta](https://wordpress.org/support/topic-tag/update_user_meta/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [Lee Wallis](https://wordpress.org/support/users/fatwombat/)
 * Last activity: [14 years, 11 months ago](https://wordpress.org/support/topic/trouble-with-plugin-development/#post-2147476)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
