ACF_Field_User::render_field_settingspublicACF 3.6.0

Renders the field settings HTML.

Method of the class: ACF_Field_User{}

No Hooks.

Returns

void. Nothing (null).

Usage

$ACF_Field_User = new ACF_Field_User();
$ACF_Field_User->render_field_settings( $field );
$field(array) (required)
The ACF field.

Changelog

Since 3.6.0 Introduced.

ACF_Field_User::render_field_settings() code ACF 6.8.8

function render_field_settings( $field ) {
	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Filter by Role', 'acf' ),
			'instructions' => '',
			'type'         => 'select',
			'name'         => 'role',
			'choices'      => acf_get_user_role_labels(),
			'multiple'     => 1,
			'ui'           => 1,
			'allow_null'   => 1,
			'placeholder'  => __( 'All user roles', 'acf' ),
		)
	);

	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Return Format', 'acf' ),
			'instructions' => '',
			'type'         => 'radio',
			'name'         => 'return_format',
			'choices'      => array(
				'array'  => __( 'User Array', 'acf' ),
				'object' => __( 'User Object', 'acf' ),
				'id'     => __( 'User ID', 'acf' ),
			),
			'layout'       => 'horizontal',
		)
	);

	acf_render_field_setting(
		$field,
		array(
			'label'        => __( 'Select Multiple', 'acf' ),
			'instructions' => 'Allow content editors to select multiple values',
			'name'         => 'multiple',
			'type'         => 'true_false',
			'ui'           => 1,
		)
	);
}