WordPress.org

Make WordPress Core

Opened 20 months ago

Last modified 18 months ago

#49356 new enhancement

Add hook into get_user_locale()

Reported by: juliobox Owned by:
Milestone: Awaiting Review Priority: normal
Severity: trivial Version: 5.4
Component: I18N Keywords: needs-patch dev-feedback
Focuses: Cc:

Description

Hey there

Like its friend get_locale(), get_user_locale() could benefit of a filter hook named "user_locale".

What do you think?

Attachments (1)

user_locale_filter_49356.patch (511 bytes) - added by vanaf1979 18 months ago.

Download all attachments as: .zip

Change History (3)

#1 @SergeyBiryukov
20 months ago

  • Component changed from General to I18N

#2 @vanaf1979
18 months ago

My patch ads a 'user_locale' filter to the get_user_locale function.

I do have two question though:

  • get_user_local can return the users locale or the sites local. Should the filter have a second "is_user_local" paramater?
  • if there is no user locale the get_user_locale function returns the value of get_locale which already has a 'locale' filter. This makes the value be filtered twice. I'm not sure if this is desired?
Note: See TracTickets for help on using tickets.