tribe_null_or_number( mixed $value = null )
Validation of Null or Numerical values for Shortcode Attributes.
Contents
We don’t use absint() since -1 is a common number used to indicate "all" or "infinite".
Parameters
- $value
-
(mixed) (Optional) Which value will be validated.
Default value: null
Return
(int|null) Sanitizes the value passed as an integer or null.
Source
File: src/functions/utils.php
function tribe_null_or_number( $value = null ) {
if ( null === $value || 'null' === $value ) {
return null;
}
return (int) $value;
}
Changelog
| Version | Description |
|---|---|
| 4.13.2 | Introduced. |