Title: pll_default_language function bug
Last modified: August 20, 2016

---

# pll_default_language function bug

 *  [l.tamburo](https://wordpress.org/support/users/ltamburo/)
 * (@ltamburo)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/pll_default_language-function-bug/)
 * Hi,
    there is a bug into function pll_default_language into file include/api.
   php on line 27.
 * $options = get_options(‘polylang’)
    get_options() not exist, correct function
   is get_option()
 * APACHE LOG ERROR:
    PHP Fatal error: Call to undefined function get_options() 
   in [cut]/wp-content/plugins/polylang/include/api.php on line 27
 * Plugin version 1.0.1
 * [http://wordpress.org/extend/plugins/polylang/](http://wordpress.org/extend/plugins/polylang/)

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

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/pll_default_language-function-bug/#post-3427783)
 * Thanks! It’s the proof that I did not test it 🙁
    There is also $arg to be replaced
   by $args at line 25.
 *  Thread Starter [l.tamburo](https://wordpress.org/support/users/ltamburo/)
 * (@ltamburo)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/pll_default_language-function-bug/#post-3427817)
 * other error is default-lang when in option is saved as default_lang
 * my fix
    /* * returns the default language */ function pll_default_language($args
   = ‘slug’) { global $polylang; return !(isset($polylang) && ($options = get_option(‘
   polylang’)) && isset($options[‘default_lang’]) && $lang = $polylang->get_language(
   $options[‘default_lang’])) ? false : ($args == ‘name’ ? $lang->name : ($args 
   == ‘locale’ ? $lang->description : $lang->slug)); }
 * Have a nice day : )
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/pll_default_language-function-bug/#post-3427819)
 * I should have been very tired when I wrote this 🙁

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

The topic ‘pll_default_language function bug’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Chouby](https://wordpress.org/support/users/chouby/)
 * Last activity: [13 years, 4 months ago](https://wordpress.org/support/topic/pll_default_language-function-bug/#post-3427819)
 * Status: not resolved