forked from DevinVinson/WordPress-Plugin-Boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Language functions
Moisés Barrachina Planelles edited this page Oct 4, 2023
·
3 revisions
Backend Frontend Template provides several functions about languages:
Returns a language list
$languages_codes_names = [
'ab' => $this->__('Abkhazian'),
'aa' => $this->__('Afar'),
'af' => $this->__('Afrikaans'),
'ak' => $this->__('Akan'),
'sq' => $this->__('Albanian'),
'am' => $this->__('Amharic'),
[...]
Returns the data stored in the setting $this->option_field_get("languages")
Returns the data stored in the setting $this->option_field_get("language_admin") if exists in $this->option_field_get("languages")
If languages empty it will set the languages 'en' and 'es'
If language_admin empty or not found on languages, it will set the first language stored in languages