rest_is_integer( mixed $maybe_integer )

Determines if a given value is integer-like.


Parameters Parameters

$maybe_integer

(mixed) (Required) The value being evaluated.


Top ↑

Return Return

(bool) True if an integer, otherwise false.


Top ↑

Source Source

File: wp-includes/rest-api.php

function rest_is_integer( $maybe_integer ) {
	return is_numeric( $maybe_integer ) && round( floatval( $maybe_integer ) ) === floatval( $maybe_integer );
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.