Add field on register form attendee
-
Hello,
I will keep displaying a field on the registration form based on the event name, however this code does not work:
Can you help me please ?
function my_custom_field($fields) {
$event_id = isset($_REQUEST[‘event_id’]) ? absint($_REQUEST[‘event_id’]) : 0;
$event = get_post($event_id);
$event_title = $event ? $event->post_title : ”;// Ajoute un champ de formulaire supplémentaire si l’événement est “Mon événement”
if ($event_title === ‘Name of Event’) {
$fields[‘mon_champ’] = array(
‘label’ => ‘Mon champ’,
‘type’ => ‘text’,
‘required’ => true,
‘placeholder’ => ‘Entrez une valeur’
);
}return $fields;
}
add_filter(‘eventin_booking_form_fields’, ‘my_custom_field’);Thanks a lot,
Regards,
Amandine
- The topic ‘Add field on register form attendee’ is closed to new replies.