acf_field_clone::get_clone_setting_choicespublicACF 5.3.8

This function will return an array of choices data for Select2

Method of the class: acf_field_clone{}

No Hooks.

Returns

(Array).

Usage

$acf_field_clone = new acf_field_clone();
$acf_field_clone->get_clone_setting_choices( $value );
$value(required)
.

Changelog

Since 5.3.8 Introduced.

acf_field_clone::get_clone_setting_choices() code ACF 6.8.8

function get_clone_setting_choices( $value ) {

	// vars
	$choices = array();

	// bail early if no $value
	if ( empty( $value ) ) {
		return $choices;
	}

	// force value to array
	$value = acf_get_array( $value );

	// loop
	foreach ( $value as $v ) {
		$choices[ $v ] = $this->get_clone_setting_choice( $v );
	}

	// return
	return $choices;
}