acf_field__group::format_value()
This filter is appied to the $value after it is loaded from the db and before it is returned to the template
Метод класса: acf_field__group{}
Хуков нет.
Возвращает
$value
. (mixed) the modified value
Использование
$acf_field__group = new acf_field__group(); $acf_field__group->format_value( $value, $post_id, $field );
- $value (обязательный)
- -
- $post_id (обязательный)
- -
- $field (обязательный)
- -
Список изменений
С версии 3.6 | Введена. |
Код acf_field__group::format_value() acf field group::format value ACF 6.0.4
function format_value( $value, $post_id, $field ) { // bail early if no value if ( empty( $value ) ) { return false; } // modify names $field = $this->prepare_field_for_db( $field ); // loop foreach ( $field['sub_fields'] as $sub_field ) { // extract value $sub_value = acf_extract_var( $value, $sub_field['key'] ); // format value $sub_value = acf_format_value( $sub_value, $post_id, $sub_field ); // append to $row $value[ $sub_field['_name'] ] = $sub_value; } // return return $value; }