WordPress Site Languages
wordpress_languagesLists the languages a multilingual WordPress site (Polylang / WPML) is set up for, and ADDS a new one. action: 'list' (default) | 'add'.
Adding the language is the FIRST step of publishing a site in another language, and skipping it fails silently: wordpress_create_post(language='de') answers ok while Polylang quietly ignores an unregistered language, so the page ends up with no language at all and falls back to the default one on its next save. list shows each language's code, locale, writing direction, post count and which one is the default.
For 'add', code is the language code you will pass to wordpress_create_post ('de', 'ru', 'ar', 'fr'); locale is optional and derived from the code when omitted; the writing direction is set automatically for right-to-left languages (Arabic, Hebrew, Persian, Urdu) unless you pass rtl yourself. Adding a language is a structural change to a multilingual site, so confirm=false PREVIEWS it — the reply says whether it can actually be added before anything is written. Adding a language twice is safe — the existing one is reported back. WPML has no API for adding languages, so there the reply says to use the WPML screen. After adding a language, create its pages and then connect them with wordpress_link_translations, otherwise the language switcher and the hreflang tags stay empty.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rtl | No | ||
| code | No | ||
| flag | No | ||
| name | No | ||
| order | No | ||
| action | No | list | |
| locale | No | ||
| confirm | No | ||
| site_url | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||