acf_field_checkbox::render_field_validation_settings
Renders the field settings used in the "Validation" tab.
Method of the class: acf_field_checkbox{}
No Hooks.
Returns
null. Nothing (null).
Usage
$acf_field_checkbox = new acf_field_checkbox(); $acf_field_checkbox->render_field_validation_settings( $field );
- $field(array) (required)
- The field settings array.
Changelog
| Since 6.0 | Introduced. |
acf_field_checkbox::render_field_validation_settings() acf field checkbox::render field validation settings code ACF 6.0.4
function render_field_validation_settings( $field ) {
acf_render_field_setting(
$field,
array(
'label' => __( 'Allow Custom Values', 'acf' ),
'name' => 'allow_custom',
'type' => 'true_false',
'ui' => 1,
'instructions' => __( "Allow 'custom' values to be added", 'acf' ),
)
);
acf_render_field_setting(
$field,
array(
'label' => __( 'Save Custom Values', 'acf' ),
'name' => 'save_custom',
'type' => 'true_false',
'ui' => 1,
'instructions' => __( "Save 'custom' values to the field's choices", 'acf' ),
'conditions' => array(
'field' => 'allow_custom',
'operator' => '==',
'value' => 1,
),
)
);
}