• I am trying to follow this debugging tutorial on adding custom booking form fields – Link

    My intention is to add a field, which is required, that is saved amongst the other user data when they register to an event. So, should they book an event again in future, the custom field will already be filled in, like the forename, surname etc…

    So far I have added my custom field to this file – event/wp-content/plugins/events-manager/templates/forms/bookingform/booking-fields.php

    <p>
    	<label for='user_practice'><?php _e('Practice','dbem') ?></label>
    	<input type="text" name="user_practice" id="user_practice" class="input" value="<?php if(!empty($_REQUEST['user_practice'])) echo esc_attr($_REQUEST['user_practice']); ?>"  />
    </p>

    Which is outside the if statement that includes the name,phone and email:

    <?php if( !is_user_logged_in() && apply_filters('em_booking_form_show_register_form',true) ): ?>
    
    <?php endif; ?>

    Half way down the support page (link above), Marcus, the plugin’s author says to use the ’em_booking_validate’ function. The only issue is, I’m not sure how or where to use it!

    I added this to the bottom of my bookings-field page, but I’ve tried submitted the form and the custom data hasn’t followed:

    <?php if( ! empty( $_REQUEST['user_practice'] ) ){
    		$EM_Booking->booking_meta['registration']['user_practice'] = wp_kses( $_REQUEST['user_practice'], array() );
    	} ?>

    Any guidance / support would be appreciated.

  • The topic ‘[Plugin: Events Manager] Custom booking form field not saving.’ is closed to new replies.