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
if ( !function_exists( 'pll_languages_list' ) ) { require_once ABSPATH . PLUGINDIR . 'polylang/include/api.php'; } // list of parameters $args = array(); // NOTICE! Understand what this does before running. $result = pll_languages_list($args);
Defined (1)
The function is defined in the following location(s).
- /include/api.php
- function pll_languages_list( $args = array() ) {
- $args = wp_parse_args( $args, array( 'fields' => 'slug' ) );
- return PLL()->model->get_languages_list( $args );
- }