Repository navigation
Abilities API: Read and write manual UTC offsets as the settings timezone - #16385
Draft
jorgefilipecosta wants to merge 3 commits into
Draft
jorgefilipecosta wants to merge 3 commits into
jorgefilipecosta wants to merge 3 commits into
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
…ist. Adds `wp_get_timezone_offset_choices()`, `wp_get_timezone_offset_choice()` and `wp_parse_timezone_offset_choice()`, which hold the manual UTC offsets that `wp_timezone_choice()` offers, such as `UTC+2`, and the conversions between those values and the `gmt_offset` option that Settings > General did inline. `wp_timezone_choice()`, `wp-admin/options.php` and `wp-admin/options-general.php` now use them. The timezone list is unchanged. Settings > General now selects `UTC+0.5` and `UTC-0.5` for a site on those offsets, instead of `UTC+0`. See #64616.
…tting. A site on a manual UTC offset keeps its `timezone_string` option empty and stores the offset in `gmt_offset`, so `core/settings-get` returned an empty timezone and `core/settings-update` could not set an offset. The `timezone` setting of both abilities now accepts and returns the manual offsets that the timezone list offers, such as `UTC+2`, next to timezone identifiers. A site without a timezone string reads as its offset. Writing an offset stores it in `gmt_offset` and empties `timezone_string`, as Settings > General does; an offset the timezone list does not offer is refused, and a refused call writes neither option. See #64616.
Follow-up to [64616]. See #66902.
jorgefilipecosta
force-pushed
the
add/settings-utc-offset-timezone
branch
from
December 2, 2026 16:14
162fa8a to
7ad2c23
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #10892.
Currently, sites using a manual offset like UTC+2 have an empty timezone_string, so core/settings-get returns an empty timezone and core/settings-update cannot set an offset.
This PR implements the following changes:
Trac ticket: https://core.trac.wordpress.org/ticket/66902
Testing
Verify unit tests are passing:
AI disclosure: the change and tests were drafted with AI assistance (Claude Code).