ShortCode

[tws_get_lang]

The [tws_get_lang] ShortCode can be used to get the current language of a post, and output either the language code, name or any of the array keys specified for it

It is great to use to conditionally check the language of a post, but also to display a custom information about the language or data related to it.

Attributes:

  • idint [post id]
  • partstring [any value as specified]

Example:

//Display the Text Direction of the current language of post 116
[tws_get_lang id="116" part="text_direction" ]
//Display the language name
[tws_get_lang id="116" part="display_name" ]
//Display the language code (very useful in WPV Conditionals)
[tws_get_lang id="116" part="language_code" ]