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

Time:05-21

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.

CodePudding user response:

?_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.

  • Related