Skip to content

Commit e26b0b9

Browse files
westonruterclaude
andcommitted
Docs: Keep the full month number type for WP_Locale::get_month().
Unlike the other `WP_Locale` getters, `get_month()` returns an empty string for a month number that is not found, which was added so that callers like `single_month_title()` can pass unvalidated query var values. Narrowing its parameter to valid month numbers told callers to validate input the method already handles, surfacing errors at call sites that pass `zeroise()` results, query vars, or database values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bed0a3a commit e26b0b9

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎src/wp-includes/class-wp-locale.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,6 @@ public function get_weekday_abbrev( $weekday_name ) {
318318
*
319319
* @param string|int $month_number '01' through '12'.
320320
* @return string Translated full month name. If the month number is not found, an empty string is returned.
321-
*
322-
* @phpstan-param int<1, 12>|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'|'10'|'11'|'12'|'01'|'02'|'03'|'04'|'05'|'06'|'07'|'08'|'09' $month_number
323321
*/
324322
public function get_month( $month_number ) {
325323
$month_number = zeroise( $month_number, 2 );

0 commit comments

Comments
 (0)