Usage of acf_render_field_setting ACF function

ACF version 5.0 introduced the field acf_render_field_setting. This allows the addition of a new field setting in the setting panel of ACF. This will display in the general field setting of every field. ACF version 6.0 introduced tabs like General, Validation, Presentation, and Conditional Logic.

ACF version 6.0

You can check it out on their official blog here, about all the features they came up with in ACF 6.0.

The resources on the ACF site is providing enough guidance for the user on how to use the function. If you wish to add setting fields for the specific tabs then you can use the functions suggested below:

  • acf/render_field_general_settings/type={type} (for adding settings to the “General” tab)
  • acf/render_field_validation_settings/type={type} (for adding settings to the “Validation” tab)
  • acf/render_field_presentation_settings/type={type} (for adding settings to the “Presentation” tab)
  • acf/render_field_conditional_logic_settings/type={type} (for adding settings to the “Conditional Logic” tab)

Below are 2 function example usage of acf_render_field_setting:

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,
		),
	)
);

Both the plugins ACF For Dokan PRO and ACF For WooCommerce are compatible with ACF version 6.0.