Documentation > Developers > Filter Examples > Add Address Fields to the Approval Form

Add Address Fields to the Approval Form

Note: This filter is only available with picu Pro

Please have a look at the available field options.


function my_picu_approval_fields( $fields ) {

	$fields = [
		[
			'type' => 'paragraph',
			'label' => 'Please enter your address.',
		],
		[
			'type' => 'text',
			'label' => 'Street',
			'placeholder' => '',
			'width' => 50,
			'required' => true,
		],
		[
			'type' => 'text',
			'label' => 'Postcode',
			'placeholder' => '',
			'width' => 20,
			'required' => true,
			'validation' => "^\d{4,5}+$",
		],
		[
			'type' => 'text',
			'label' => 'City',
			'placeholder' => '',
			'width' => 30,
			'required' => true,
		],
		[
			'type' => 'select',
			'label' => 'Country',
			'width' => 50,
			'required' => true,
			'options' => [
				'de|Germany',
				'at|Austria',
				'ch|Switzerland',
			],
			'value' => 'ch',
		],
	];

	return $fields;
}

add_filter( 'picu_approval_fields', 'my_picu_approval_fields' );Code language: PHP (php)

Need help?

If you couldn’t find what you were looking for and need more assistance, please get in touch with us directly and we’re happy to help.