- availability:
-
WPML Version: 3.2
- description:
-
Returns the translated name of a language in another specified language.
*Note: The languages involved do not need to be active for the site
- type:
- filter
- category:
- Site-Wide Language Information
- parameters:
-
apply_filters( 'wpml_translated_language_name', mixed $empty_value, string $lang_code, string $display_code )
- $empty_value
- (mixed) (Required) This is normally the value the filter will be modifying. We are not filtering anything here so set this to NULL. This for the filter function to actually receive the full argument list
- $lang_code
- (string) (Required) The language name will be for this language. Accepts a 2-letter code e.g. en
- $display_code
- (string|bool) (Optional) The language name will display translated in this language. Accepts a 2-letter code e.g. de. If set to false it will return the translated name in the current language. Default is FALSE.
- hook example usage:
-
A basic example
// will return the translation for 'Italian' in Greek echo apply_filters( 'wpml_translated_language_name', NULL, 'it', 'el' );