Title: pll_default_language
Last modified: August 31, 2016

---

# pll_default_language

 *  [olidac](https://wordpress.org/support/users/olidac/)
 * (@olidac)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/pll_default_language/)
 * Hello,
 * the new version break my site :
 * Backtrace from warning ‘Undefined index: default_lang’ at /app/wp-content/plugins/
   polylang/include/api.php 55
 * [https://wordpress.org/plugins/polylang/](https://wordpress.org/plugins/polylang/)

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

 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/pll_default_language/#post-6962530)
 * Hi!
 * Could you check if you have a default language in the Languages list table? It
   should be marked with a star.
 *  Thread Starter [olidac](https://wordpress.org/support/users/olidac/)
 * (@olidac)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/pll_default_language/#post-6962546)
 *     ```
       function pll_default_language( $field = 'slug' ) {
       	return ( $lang = PLL()->model->get_language( PLL()->options['default_lang'] ) ) && isset( $lang->$field ) ? $lang->$field : false;
       }
       ```
   
 * It is necessary to check existence of the value :
    `isset(PLL()->options['default_lang'])`
 * I need the plugin to work without a default lang.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/pll_default_language/#post-6962557)
 * Unless you delete it (and you need to code to do that), Polylang has *always*
   a default language (otherwise some features wouldn’t correctly work). That’s 
   why I don’t need to check it. And nobody should expect pll_default_language()
   to return false.
 * If you succeeded to suppress the default language, why are you calling pll_default_language()?

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

The topic ‘pll_default_language’ 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: [10 years, 5 months ago](https://wordpress.org/support/topic/pll_default_language/#post-6962557)
 * Status: not resolved