acf_field_repeater::render_field_presentation_settingspublicACF 6.0

Renders the field settings used in the "Presentation" tab.

Method of the class: acf_field_repeater{}

No Hooks.

Returns

null. Nothing (null).

Usage

$acf_field_repeater = new acf_field_repeater();
$acf_field_repeater->render_field_presentation_settings( $field );
$field(array) (required)
The field settings array.

Changelog

Since 6.0 Introduced.

acf_field_repeater::render_field_presentation_settings() code ACF 6.8.8

function render_field_presentation_settings( $field ) {
	$choices = array();
	if ( $field['collapsed'] ) {
		$sub_field = acf_get_field( $field['collapsed'] );

		if ( $sub_field ) {
			$choices[ $sub_field['key'] ] = $sub_field['label'];
		}
	}

	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Collapsed', 'acf' ),
			'instructions' => __( 'Select a sub field to show when row is collapsed', 'acf' ),
			'type'         => 'select',
			'name'         => 'collapsed',
			'allow_null'   => 1,
			'choices'      => $choices,
		)
	);

	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Button Label', 'acf' ),
			'instructions' => '',
			'type'         => 'text',
			'name'         => 'button_label',
			'placeholder'  => __( 'Add Row', 'acf' ),
		)
	);
}