#39018 closed defect (bug) (worksforme)
gmt_offset is not set when timezone strings are used
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 4.6.1 |
| Component: | Options, Meta APIs | Keywords: | |
| Focuses: | administration | Cc: |
Description
Steps to reproduce
- Create a clean install
- Go to Settings > General
- Change time zone to any string that is not UTC+-
- View
gmt_offsetinwp_options, it will be empty
Notes
This appears to happen here:
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/options.php#L177
If gmt_offset is empty, then current_time always returns UTC time.
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/functions.php#L61
Change History (2)
Note: See
TracTickets for help on using
tickets.
Came into this with fresh eyes this morning, it appears that this filter exists:
This comes into play when
get_option( 'gmt_offset' )is used. It will convert the timezone string into a UTC offset and return it.