AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
Notifications
Clear all

[Solved] Translating timezones list

3 Posts
2 Users
0 Reactions
1,235 Views
Posts: 9
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@buzzyclub)
Eminent Member
Joined: 5 years ago
[#51260]

Hello everyone.

I am looking into changing the timezones in the profile tab. I've added the code below to functions.php to change profile locations, and it worked fine. Which I assume modifying timezones follow the same concept. However, I want to make sure I'm taking the correct steps to avoid any issues.

Thanks!

function custom_wpforo_user_locations( $user_fields ){
    if( isset($user_fields['location']['values']) ) {
        $user_fields['location']['values'] =
            array(
                //Custom Locations:
                'a1',
                'b2',
                'c3',
            );
    }
    return $user_fields;
}
add_filter('wpforo_member_after_init_fields', 'custom_wpforo_user_locations', 10);

2 Replies
Posts: 9
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
(@buzzyclub)
Eminent Member
Joined: 5 years ago

Just to clarify, am looking for the filter hook to modify the time zones.

Would appreciate it if anyone shares it/helps in showing steps to modify time zones, I've been looking into the documentation but couldn't find anything.


1 Reply
Sofy
 Sofy
Admin
(@sofy)
Joined: 8 years ago

Support Team
Posts: 5774
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian

@buzzyclub,

We don't recommend you change the timezon as those are used on many wpForo functions, so if you change it may lead to several issues.

If you still want to change you can use the example you've provided. Alternatively, we recommend considering a solution where you simply reduce the list of available timezones for a smoother transition.


Share: