acf_field_color_picker::render_field_settings()publicACF 3.6

Create extra options for your field. This is rendered when editing a field. The value of $field['name'] can be used (like bellow) to save extra data to the $field

@type action

{} Это метод класса: acf_field_color_picker{}

Хуков нет.

Возвращает

null. Ничего.

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

$acf_field_color_picker = new acf_field_color_picker();
$acf_field_color_picker->render_field_settings( $field );
$field (обязательный)
-

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

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

Код acf_field_color_picker::render_field_settings() ACF 5.10.2

function render_field_settings( $field ) {

	// display_format
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Default Value', 'acf' ),
			'instructions' => '',
			'type'         => 'text',
			'name'         => 'default_value',
			'placeholder'  => '#FFFFFF',
		)
	);

	// Toggle opacity control.
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Enable Transparency', 'acf' ),
			'instructions' => '',
			'type'         => 'true_false',
			'name'         => 'enable_opacity',
			'ui'           => 1,
		)
	);

	// Return format control.
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Return Format', 'acf' ),
			'instructions' => '',
			'type'         => 'radio',
			'name'         => 'return_format',
			'layout'       => 'horizontal',
			'choices'      => array(
				'string' => __( 'Hex String', 'acf' ),
				'array'  => __( 'RGBA Array', 'acf' ),
			),
		)
	);

}