Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the meaning of `user=locale` in WordPress?

I’m looking at wp-admin\js\application-passwords.jsand I’m trying to reuse this JS file on the frontend.

But in the code, there’s like,

    wp.apiRequest( {
        path: '/wp/v2/users/' + userId + '/application-passwords?_locale=user',
        method: 'POST',
        data: request

What is _locale=user for? Is that for authentication cos I’m looking for a way to send authenticate details to the REST API for each request.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

?_locale=user is used to ensure the user’s locale (user’s default site language) is respected when a REST API request is handled.

It has no auth params, just the language preferences.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading