Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are trying to replace the

wpml_language

field with

lang

in Swagger documentation while using the WP API SwaggerUI plugin to ensure consistency with your REST API structure. You could not find information on modifying this field in the WP API SwaggerUI plugin or WPML documentation.
Solution:
We do not provide a built-in option to rename the

wpml_language

field directly in the REST API. However, you can modify the API response using filters or by extending the WP API SwaggerUI plugin. If you need further help with custom coding, we recommend hiring WPML contractors. You can find them here: https://wpml.org/contractors/

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If this does not resolve your issue, please open a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Tagged: 

This topic contains 1 reply, has 0 voices.

Last updated by Dražen 2 weeks, 4 days ago.

Assisted by: Dražen.

Author Posts
February 4, 2025 at 5:08 am #16664880

cristianP-12

Background of the issue:
I am trying to replace the wpml_language field with lang in Swagger documentation while using the WP API SwaggerUI plugin. This is to ensure consistency with our REST API structure. I want to know if WPML provides a way to modify this field name while keeping multilingual functionality intact.

Symptoms:
I couldn't find any specific information on modifying the wpml_language field name to lang in the WP API SwaggerUI plugin documentation and WPML documentation.

Questions:
Is there a way to modify the wpml_language field to lang while maintaining WPML functionality?

February 4, 2025 at 7:48 am #16665089

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+01:00)

Hello,

WPML does not provide a built-in option to rename the wpml_language field directly in the REST API. However, you can achieve this by modifying the API response using filters or by extending the WP API SwaggerUI plugin.

If you need further help with custom coding, we suggest hiring WPML contractors:

- https://wpml.org/contractors/

Regards,
Drazen