acf_get_numeric() ACF 5.4.0
This function will return numeric values
Хуков нет.
Возвращает
(Разное).
Использование
acf_get_numeric( $value );
- $value **
- -
По умолчанию: ''
Список изменений
С версии 5.4.0 | Введена. |
Код acf_get_numeric() acf get numeric ACF 5.9.1
function acf_get_numeric( $value = '' ) {
// vars
$numbers = array();
$is_array = is_array($value);
// loop
foreach( (array) $value as $v ) {
if( is_numeric($v) ) $numbers[] = (int) $v;
}
// bail early if is empty
if( empty($numbers) ) return false;
// convert array
if( !$is_array ) $numbers = $numbers[0];
// return
return $numbers;
}