acf_field_flexible_content::prepare_field_for_export
Handles preparing the layouts for export.
Method of the class: acf_field_flexible_content{}
No Hooks.
Returns
array. The export ready field array.
Usage
$acf_field_flexible_content = new acf_field_flexible_content(); $acf_field_flexible_content->prepare_field_for_export( $field );
- $field(array) (required)
- The whole fiel array.
Changelog
| Since 5.0.0 | Introduced. |
acf_field_flexible_content::prepare_field_for_export() acf field flexible content::prepare field for export code ACF 6.8.8
public function prepare_field_for_export( $field ) {
// loop
if ( ! empty( $field['layouts'] ) ) {
foreach ( $field['layouts'] as &$layout ) {
$layout['sub_fields'] = acf_prepare_fields_for_export( $layout['sub_fields'] );
}
}
// return
return $field;
}