PHP Интерфейс Inpsyde\MultilingualPress\API\Languages

С версии: 3.0.0
Показать файл Открыть проект Примеры использования интерфейса

Открытые методы

Метод Описание
get_all_languages ( ) : object[] Returns an array with objects of all available languages.
get_language_by_http_code ( string $http_code, string $field = 'native_name', string | string[] $fallbacks = ['native_name', 'english_name'] ) : string | string[] Returns the desired field value of the language with the given HTTP code.
get_languages ( array $args = [] ) : object[] Returns all languages according to the given arguments.
update_languages_by_id ( array $languages ) : integer Updates the given languages.

Описание методов

get_all_languages() публичный метод

Returns an array with objects of all available languages.
С версии: 3.0.0
public get_all_languages ( ) : object[]
Результат object[] The array with objects of all available languages.

get_language_by_http_code() публичный метод

Returns the desired field value of the language with the given HTTP code.
С версии: 3.0.0
public get_language_by_http_code ( string $http_code, string $field = 'native_name', string | string[] $fallbacks = ['native_name', 'english_name'] ) : string | string[]
$http_code string Language HTTP code.
$field string Optional. The field which should be queried. Defaults to 'native_name'.
$fallbacks string | string[] Optional. Falback language fields. Defaults to native and English name.
Результат string | string[] The desired field value, an empty string on failure, or an array for field 'all'.

get_languages() публичный метод

Returns all languages according to the given arguments.
С версии: 3.0.0
public get_languages ( array $args = [] ) : object[]
$args array Arguments.
Результат object[] The array with objects of all languages according to the given arguments.

update_languages_by_id() публичный метод

Updates the given languages.
С версии: 3.0.0
public update_languages_by_id ( array $languages ) : integer
$languages array An array with language IDs as keys and one or more fields as values.
Результат integer The number of updated languages.