acf/pre_render_fields
Filters the $fields array before they are rendered.
Использование
add_filter( 'acf/pre_render_fields', 'wp_kama_acf_pre_render_fields_filter', 10, 2 ); /** * Function for `acf/pre_render_fields` filter-hook. * * @param array $fields An array of fields. * @param int|string $post_id The post ID to load values from. * * @return array */ function wp_kama_acf_pre_render_fields_filter( $fields, $post_id ){ // filter... return $fields; }
- $fields(массив)
- An array of fields.
- $post_id(int|строка)
- The post ID to load values from.
Список изменений
С версии 5.0.0 | Введена. |
Где вызывается хук
acf/includes/acf-field-functions.php 599
$fields = apply_filters( 'acf/pre_render_fields', $fields, $post_id );