acf_field_clone::get_clone_setting_choice()publicACF 5.3.8

get_clone_setting_choice

This function will return the label for a given clone choice

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

Хуков нет.

Возвращает

(Строку).

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

$acf_field_clone = new acf_field_clone();
$acf_field_clone->get_clone_setting_choice( $selector );
$selector **
-
По умолчанию: ''

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

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

Код acf_field_clone::get_clone_setting_choice() ACF 6.0.4

function get_clone_setting_choice( $selector = '' ) {

	// bail early no selector
	if ( ! $selector ) {
		return '';
	}

	// phpcs:disable WordPress.Security.NonceVerification.Missing -- Verified elsewhere.
	// ajax_fields
	if ( isset( $_POST['fields'][ $selector ] ) ) {

		return $this->get_clone_setting_field_choice( acf_sanitize_request_args( $_POST['fields'][ $selector ] ) );

	}
	// phpcs:enable WordPress.Security.NonceVerification.Missing

	// field
	if ( acf_is_field_key( $selector ) ) {

		return $this->get_clone_setting_field_choice( acf_get_field( $selector ) );

	}

	// group
	if ( acf_is_field_group_key( $selector ) ) {

		return $this->get_clone_setting_group_choice( acf_get_field_group( $selector ) );

	}

	// return
	return $selector;

}