acf_field_flexible_content::pre_render_fields
Runs on the "acf/pre_render_fields" filter. Used to signify that we're currently rendering a Flexible Content field.
Method of the class: acf_field_flexible_content{}
No Hooks.
Returns
array.
Usage
$acf_field_flexible_content = new acf_field_flexible_content(); $acf_field_flexible_content->pre_render_fields( $fields, $post_id );
- $fields(array) (required)
- The main field array.
- $post_id(mixed)
- The post ID for the field being rendered.
Default:false
Changelog
| Since 6.5 | Introduced. |
acf_field_flexible_content::pre_render_fields() acf field flexible content::pre render fields code ACF 6.8.8
public function pre_render_fields( $fields, $post_id = false ) {
if ( is_admin() ) {
$this->post_id = $post_id;
}
return $fields;
}