pll_default_language

Returns the default language.

Description

(string) pll_default_language( (string) $field = 'slug' ); 

Returns (string)

the requested field for the default language

Parameters (1)

0. $field — Optional. (string) => 'slug'
The language field to return name,, locale, defaults to slug

Usage

  1. if ( !function_exists( 'pll_default_language' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'polylang/include/api.php'; 
  3.  
  4. // optional the language field to return 'name', 'locale', defaults to 'slug' 
  5. $field = 'slug'; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pll_default_language($field); 
  9.  

Defined (1)

The function is defined in the following location(s).

/include/api.php  
  1. function pll_default_language( $field = 'slug' ) { 
  2. return isset( PLL()->options['default_lang'] ) && ( $lang = PLL()->model->get_language( PLL()->options['default_lang'] ) ) && isset( $lang->$field ) ? $lang->$field : false;