WordPress build repository browser


Ignore:
Timestamp:
11/04/2026 11:10:01 PM (5 days ago)
Author:
westonruter
Message:

Docs: Allow numeric strings for date parts and meta IDs.

The wp_checkdate() and *_metadata_by_mid() functions already validate their numeric arguments with is_numeric() and cast them to integers, and core callers pass strings: date parts cut from a date string, and meta IDs read with $wpdb->get_col(). Their docblocks still documented int only, which caused 17 PHPStan argument.type errors. The arguments are now documented as int|string, with PHPStan narrowing them to int|numeric-string. The checkdate() ranges are deliberately not applied to wp_checkdate(), since the function's purpose is to validate input that may be out of range.

Developed in ​https://github.com/WordPress/wordpress-develop/pull/15472.
Follow-up to r18494, r20435, r38699, r61172.

Props pwtyler, westonruter.
See #65817.

Built from ​https://develop.svn.wordpress.org/trunk@65269

File:
1 edited

Legend:

Unmodified
Added
Removed
Note: See TracChangeset for help on using the changeset viewer.