acf_field_select::format_value() public ACF 3.6
This filter is appied to the $value after it is loaded from the db and before it is returned to the template
{} Это метод класса: acf_field_select{}
Хуков нет.
Возвращает
$value. (mixed) the modified value
Использование
$acf_field_select = new acf_field_select(); $acf_field_select->format_value( $value, $post_id, $field );
- (mixed)($value) (обязательный)
- the value which was loaded from the database
- (mixed)($post_id) (обязательный)
- the $post_id from which the value was loaded
- (array)($field) (обязательный)
- the field array holding all the field options
Список изменений
С версии 3.6 | Введена. |
Код acf_field_select::format_value() acf field select::format value ACF 5.9.1
function format_value( $value, $post_id, $field ) {
if( is_array( $value ) ) {
foreach( $value as $i => $val ) {
$value[ $i ] = $this->format_value_single( $val, $post_id, $field );
}
} else {
$value = $this->format_value_single( $value, $post_id, $field );
}
return $value;
}