[wp-trac] [WordPress Trac] #64522: Clarify expected behavior for invalid weekday values in WP_Locale::get_weekday()
WordPress Trac
noreply at wordpress.org
Fri Jan 16 15:14:43 UTC 2026
#64522: Clarify expected behavior for invalid weekday values in
WP_Locale::get_weekday()
--------------------------+-----------------------------
Reporter: shishir1 | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: I18N | Version: trunk
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
While working on a pull request to prevent an undefined index notice in
WP_Locale::get_weekday(), it became clear that the current behavior for
invalid weekday values (e.g. 7) is intentional and covered by existing
unit tests.
This ticket is to discuss whether the current behavior should remain as-
is, or whether a more explicit developer-facing warning (such as using
_doing_it_wrong()) would be more appropriate, particularly for newer PHP
versions.
Related PR: https://github.com/WordPress/wordpress-develop/pull/10722
Feedback and guidance would be appreciated before proposing any changes.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64522>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list