pll_languages_list

Returns the list of available languages.

Description

(array) pll_languages_list( (array) $args = array() ); 

List of parameters accepted in $args:

hide_empty => hides languages with no posts if set to true ( defaults to false ) fields => return only that field if set ( see PLL_Language for a list of fields )

Returns (array)

Parameters (1)

0. $args — Optional. (array) => array()
List of parameters

Usage

  1. if ( !function_exists( 'pll_languages_list' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'polylang/include/api.php'; 
  3.  
  4. // list of parameters 
  5. $args = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = pll_languages_list($args); 
  9.  

Defined (1)

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

/include/api.php  
  1. function pll_languages_list( $args = array() ) { 
  2. $args = wp_parse_args( $args, array( 'fields' => 'slug' ) ); 
  3. return PLL()->model->get_languages_list( $args );