acf_field_radio::render_field_validation_settingspublicACF 6.0

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

Method of the class: acf_field_radio{}

No Hooks.

Returns

null. Nothing (null).

Usage

$acf_field_radio = new acf_field_radio();
$acf_field_radio->render_field_validation_settings( $field );
$field(array) (required)
The field settings array.

Changelog

Since 6.0 Introduced.

acf_field_radio::render_field_validation_settings() code ACF 6.0.4

function render_field_validation_settings( $field ) {
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Allow Null?', 'acf' ),
			'instructions' => '',
			'name'         => 'allow_null',
			'type'         => 'true_false',
			'ui'           => 1,
		)
	);

	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Allow Other Choice', 'acf' ),
			'name'         => 'other_choice',
			'type'         => 'true_false',
			'ui'           => 1,
			'instructions' => __( "Add 'other' choice to allow for custom values", 'acf' ),
		)
	);

	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Save Other Choice', 'acf' ),
			'name'         => 'save_other_choice',
			'type'         => 'true_false',
			'ui'           => 1,
			'instructions' => __( "Save 'other' values to the field's choices", 'acf' ),
			'conditions'   => array(
				'field'    => 'other_choice',
				'operator' => '==',
				'value'    => 1,
			),
		)
	);
}