Make WordPress Core

Opened 7 years ago

Closed 22 months ago

#49356 closed enhancement (maybelater)

Add hook into get_user_locale()

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

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 7 years ago.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
7 years ago

  • Component General → I18N

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

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

#4 @swissspidy
23 months ago

  • Keywords close added

#5 @desrosj
22 months ago

  • Keywords reporter-feedback added; dev-feedback removed
  • Milestone Awaiting Review
  • Resolution → maybelater
  • Status new → 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.