• 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/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Polylang] pll_default_language errors.’ is closed to new replies.