PHP 인터페이스 Inpsyde\MultilingualPress\API\Languages

부터: 3.0.0
파일 보기 프로젝트 열기: inpsyde/multilingual-press 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.