On this page
rest_is_integer( mixed $maybe_integer ): bool
Determines if a given value is integer-like.
Parameters
$maybe_integermixed Required-
The value being evaluated.
Return
bool True if an integer, otherwise false.
Source
File: wp-includes/rest-api.php. View all references
function rest_is_integer( $maybe_integer ) {
return is_numeric( $maybe_integer ) && round( (float) $maybe_integer ) === (float) $maybe_integer;
}
Related
Used By
| Used By | Description |
|---|---|
| rest_validate_integer_value_from_schema() wp-includes/rest-api.php | Validates an integer value based on a schema. |
Changelog
| Version | Description |
|---|---|
| 5.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/rest_is_integer