Get Polylang available languages on admin page of my plugin [closed]

According to Polylangs Function Reference, pll_the_languages

Displays a language switcher.

And most probably it uses some additional CSS/JS to work. If you want to get the list of languages and display them with your custom code, then you can use this function instead:

pll_languages_list($args);

and it will return the list of languages.

$args is an optional array parameter. Options are:

  • ‘hide_empty’ => hides languages with no posts if set to 1 (default: 0)
  • ‘fields’ => returns only that field if set. Possible values are
    ‘slug’, ‘locale’, ‘name’, defaults to ‘slug’