acf_field_select::format_value_single() public ACF 1.0
{} Это метод класса: acf_field_select{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$acf_field_select = new acf_field_select(); $acf_field_select->format_value_single( $value, $post_id, $field );
Код acf_field_select::format_value_single() acf field select::format value single ACF 5.9.1
function format_value_single( $value, $post_id, $field ) {
// bail ealry if is empty
if( acf_is_empty($value) ) return $value;
// vars
$label = acf_maybe_get($field['choices'], $value, $value);
// value
if( $field['return_format'] == 'value' ) {
// do nothing
// label
} elseif( $field['return_format'] == 'label' ) {
$value = $label;
// array
} elseif( $field['return_format'] == 'array' ) {
$value = array(
'value' => $value,
'label' => $label
);
}
// return
return $value;
}