WPX

Update WordPress installation language

Changed on

This function sets the active WordPress language for an installation that the caller owns. The system installs the translation files if the site does not already have them, then activates the locale.

Note:

  • The system verifies that the caller owns the installation before it changes anything.
  • get_admin_account does not report the active language. There is no function that reads it back.
post/WPX/set_language

Request

  • Base URL
    https://cpanel-server.tld:2083/execute
  • Auth
    HTTP basic

Request body application/x-www-form-urlencoded

idinteger required

The WordPress Toolkit installation id, as returned in the wptk_id field of list_websites.

languagestring required

The WordPress locale to activate, for example en_US, de_DE, or pt_BR. This is a WordPress locale, not a cPanel locale. The system accepts any locale name that matches the documented pattern, so the list is not fixed. A locale that WordPress does not publish fails when the system tries to install its translation files. The en_US locale needs no translation files, so the system only activates it.

Example request

{
  "id": 17,
  "language": "de_DE"
}

Response

The HTTP request was successful.

apiversioninteger

The version of the API.

funcstring

The name of the method called.

modulestring

The name of the module called.

Example response

{
  "apiversion": 3,
  "func": "set_language",
  "module": "WPX",
  "result": {
    "data": {
      "id": 17,
      "language": "de_DE"
    },
    "metadata": {
      "transformed": 1
    },
    "status": 1
  }
}

Changes