Make WordPress Core

Opened 5 years ago

Closed 3 months ago

#49356 closed enhancement (maybelater)

Add hook into get_user_locale()

Reported by: juliobox's profile juliobox Owned by:
Milestone: Priority: normal
Severity: trivial Version: 5.4
Component: I18N Keywords: needs-patch close reporter-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 5 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to I18N

#2 @vanaf1979
5 years 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?

#3 @swissspidy
5 months ago

What's the use case for this? Can't the existing metadata filter be used if needed?

#4 @swissspidy
5 months ago

  • Keywords close added

#5 @desrosj
3 months ago

  • Keywords reporter-feedback added; dev-feedback removed
  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

It's been several weeks and no use case has been shared. Since it's been 5 years without additional requests for this, I'm going to close this out as a maybelater.

Discussion can always continue on closed tickets and they can be reopened if new context/information is provided.

Note: See TracTickets for help on using tickets.