Repository navigation
Commit 0181606
Date/Time: Handle a missing post weekday in the_weekday() and the_weekday_date().
`get_post_time()` returns false when the post date cannot be parsed. Both
functions passed that straight to `WP_Locale::get_weekday()`, where it was
coerced to the array key 0, so the post was silently labeled Sunday. Now
nothing is output in that case, and the filterable string result is cast and
clamped to 0-6 to match the `int<0, 6>` type of `WP_Locale::get_weekday()`.
This removes the corresponding entry from the `argument.type` PHPStan baseline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent e4f3252 commit 0181606
2 files changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3436 | 3436 | | |
3437 | 3437 | | |
3438 | 3438 | | |
3439 | | - | |
| 3439 | + | |
| 3440 | + | |
| 3441 | + | |
| 3442 | + | |
| 3443 | + | |
| 3444 | + | |
| 3445 | + | |
3440 | 3446 | | |
3441 | 3447 | | |
3442 | 3448 | | |
| |||
3473 | 3479 | | |
3474 | 3480 | | |
3475 | 3481 | | |
| 3482 | + | |
3476 | 3483 | | |
3477 | | - | |
| 3484 | + | |
3478 | 3485 | | |
3479 | | - | |
| 3486 | + | |
3480 | 3487 | | |
3481 | 3488 | | |
3482 | 3489 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
953 | 953 | | |
954 | 954 | | |
955 | 955 | | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | 956 | | |
962 | 957 | | |
963 | 958 | | |
| |||
0 commit comments