polylang-object-translations
Installation
SKILL.md
Polylang Object Translations
Use this skill when code needs to read or write the relationship between translated posts or translated terms.
Polylang stores language and translation relationships through private taxonomies, not custom tables:
| Object | Language taxonomy | Translation group taxonomy |
|---|---|---|
| Posts/CPTs/attachments | language |
post_translations |
| Terms | term_language |
term_translations |
Do not write those terms or term descriptions directly. Use Polylang APIs so caches, cleanup, validation, and synchronization hooks run.
Resolve translated IDs
For posts:
$translated_id = pll_get_post( $post_id, 'fr' );