1

I'm having a super hard time finding the names of the default user meta that's included with WPML. WPML has a setting for "Default Admin Language" under every user's profile. I'd like to access this on the front end so all my users are automatically switched to their selected language on login. I can't figure out the correct key to use to access the custom meta.

Screenshot of WPML option in user profile

So far, I've tried:

<?php 
    $user = wp_get_current_user();
    echo get_user_meta($user->ID, 'icl_user_admin_language', true); 
?>

and

<?php 
    $user = wp_get_current_user();
    var_dump(get_user_meta($user->ID, 'icl_user_admin_language')); 
?>

but both of these options come up empty. I'm assuming it's because I'm not using the correct key for the user meta, but I've tried googling and I've even dug through the documentation, and I can't find mention of this. Anyone have some insight as to how I can grab the language that a user has set from the front end of the site?

closed as off-topic by fuxia Dec 6 '14 at 1:31

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1

Turns out that the correct key was icl_admin_language. I was able to drop the key from the "get_user_meta" function and then print_r the variable. This showed me all custom user meta which I could then sift through for my desired key.

Not the answer you're looking for? Browse other questions tagged or ask your own question.