ACF_Repeater_Table::prepare_valueprivateACF 6.0.0

Prepares the repeater values for rendering.

Method of the class: ACF_Repeater_Table{}

No Hooks.

Returns

Array.

Usage

// private - for code of main (parent) class only
$result = $this->prepare_value();

Changelog

Since 6.0.0 Introduced.

ACF_Repeater_Table::prepare_value() code ACF 6.8.8

private function prepare_value() {
	$value = is_array( $this->field['value'] ) ? $this->field['value'] : array();

	if ( empty( $this->field['pagination'] ) ) {
		// If there are fewer values than min, populate the extra values.
		if ( $this->field['min'] ) {
			$value = array_pad( $value, $this->field['min'], array() );
		}

		// If there are more values than max, remove some values.
		if ( $this->field['max'] ) {
			$value = array_slice( $value, 0, $this->field['max'] );
		}
	}

	$value['acfcloneindex'] = array();

	return $value;
}