Title: [Plugin: Polylang] pll_default_language errors.
Last modified: August 20, 2016

---

# [Plugin: Polylang] pll_default_language errors.

 *  [Nerdvous](https://wordpress.org/support/users/nerdvous/)
 * (@nerdvous)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/polylang-pll_default_language-errors/)
 * First of all, kudos on adding a default language function in the api and saving
   the others some code maintenance.
 * That being said … the function is full of typos. 🙂
    They all probably came from
   copy pasting code around. I managed to fix it, but it’d be really nice to fix
   it on your end in the next release.
 *     ```
       function pll_default_language($arg = 'slug') {
       	global $polylang;
       	return !(isset($polylang) && ($options = get_options('polylang')) && isset($options['default-lang']) && $lang = $polylang->get_language($options['default-lang'])) ? false :
       		($args == 'name' ? $lang->name :
       		($args == 'locale' ? $lang->description :
       		$lang->slug));
       }
       ```
   
 * There are 3 of them:
    -1: The function argument is $arg, but are trying to get
   the values from $args. -2: The get_option function is misspelled (has an ‘s’ 
   at the end). -3: The key for the default language options is ‘default_lang’, 
   not ‘default-lang’ (underscore vs hyphen (i checked the database)).
 * After that the function worked like a charm.
 * Again – Great new feature (for the developers). Just needs a bit more tweaking.
   🙂
 * [http://wordpress.org/extend/plugins/polylang/](http://wordpress.org/extend/plugins/polylang/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/polylang-pll_default_language-errors/#post-3449484)
 * Thank you for your support! I am already aware of these issues ([http://wordpress.org/support/topic/pll_default_language-function-bug](http://wordpress.org/support/topic/pll_default_language-function-bug))
   that will of course be corrected in the next release.
 *  Thread Starter [Nerdvous](https://wordpress.org/support/users/nerdvous/)
 * (@nerdvous)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/polylang-pll_default_language-errors/#post-3449583)
 * Thanks for the fast reply (and sorry i’m a little late).
 * Apologies for reporting an already posted issue. I could not find the topic you
   referenced on my own when i wrote it.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Polylang] pll_default_language errors.’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [Nerdvous](https://wordpress.org/support/users/nerdvous/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/polylang-pll_default_language-errors/#post-3449583)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
