ACF_Field_Group::pre_update_field_grouppublicACF 6.1

Filters the field group data before it is updated in the database.

Method of the class: ACF_Field_Group{}

No Hooks.

Returns

Array.

Usage

$ACF_Field_Group = new ACF_Field_Group();
$ACF_Field_Group->pre_update_field_group( $field_group );
$field_group(array) (required)
The field group being updated.

Changelog

Since 6.1 Introduced.

ACF_Field_Group::pre_update_field_group() code ACF 6.8.8

public function pre_update_field_group( $field_group ) {
	// Remove empty values and convert to associated array.
	if ( $field_group['location'] ) {
		$field_group['location'] = array_filter( $field_group['location'] );
		$field_group['location'] = array_values( $field_group['location'] );
		$field_group['location'] = array_map( 'array_filter', $field_group['location'] );
		$field_group['location'] = array_map( 'array_values', $field_group['location'] );
	}

	return $field_group;
}