acf_format_numerics()
Convert any numeric strings into their equivalent numeric type. This function will work with both single values and arrays.
Хуков нет.
Возвращает
Разное.
Использование
acf_format_numerics( $value );
- $value(разное) (обязательный)
- Either a single value or an array of values.
Код acf_format_numerics() acf format numerics ACF 6.4.2
function acf_format_numerics( $value ) {
if ( is_array( $value ) ) {
return array_map(
function ( $v ) {
return is_numeric( $v ) ? $v + 0 : $v;
},
$value
);
}
return is_numeric( $value ) ? $value + 0 : $value;
}