Query the language for the entity, and the IDs for the translations for that entity.
These types implement interface PolylangTranslatable. (Type Media does only when media support is enabled, via the Polylang settings.)
Field
Description
polylangLanguage
Language code of the post or page, or null if no language was assigned (eg: Polylang was installed later on).
polylangTranslationLanguageIDs
Nodes for all the translation languages for the entity, as a JSON object with the language code as key and entity ID as value, or null if no language was assigned (eg: Polylang was installed later on).
Field polylangTranslationLanguageIDs provides the post/page IDs for all the translations. It accepts field includeSelf, to indicate if to include the queried entity's ID in the results (it's false by default).
These types implement interface PolylangMaybeTranslatable.
GenericCustomPost is a type used to represent any custom post installed on the site, such as Portfolio, Event, Product, or other. Similarly, GenericTag and GenericCategory are used to represent their taxonomies.
Each of these CPTs and taxonomies can be defined to be translatable on the Polylang settings. Fields polylangLanguage and polylangTranslationLanguageIDs will then have the same behavior as for Post and the others (described above), and also return null if the entity's CPT or taxonomy is not configured to be translated.
In addition, field polylangIsTranslatable indicates if the CPT or taxonomy is configured to be translatable.
Field
Description
polylangLanguage
Language code of the post or page, or null if no language was assigned (eg: Polylang was installed later on), or if the entity is not configured to be translated (via Polylang Settings).
polylangTranslationLanguageIDs
Nodes for all the translation languages for the entity, as a JSON object with the language code as key and entity ID as value, or null if no language was assigned (eg: Polylang was installed later on), or if the entity is not configured to be translated (via Polylang Settings).