ACF_Repeater_Table::prepare_value()privateACF 6.0.0

Prepares the repeater values for rendering.

Метод класса: ACF_Repeater_Table{}

Хуков нет.

Возвращает

Массив.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->prepare_value();

Список изменений

С версии 6.0.0 Введена.

Код ACF_Repeater_Table::prepare_value() ACF 6.0.4

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;
}