• Resolved moaschtr

    (@moaschtr)


    Hi all,
    a quick question:

    I am using customized registration fields (address and zip code) on my regular wordpress registration, using mainly this code.
    Since I do allow guest-booking on my events, wordpress requires users to fill out also address and zip code (error messages, because they can’t enter them in the original form). Now to enable users to do that, I succesfully hooked em_register_form function to add those fields to the booking form.

    Now my question:
    Since I’m quite new to wordpress and neither a coding expert: Is this a proper method of adding my fields or bears that any risks? Is it really that simple? ?? I read about data validation/sanitation, is this done automatically by wordpress?

    Thanks for your info!

    https://www.ads-software.com/plugins/events-manager/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    Can you post the code you used to hook into em_register_form?

    Thread Starter moaschtr

    (@moaschtr)

    Sure, my fields are ‘adresse’, ‘plz’ and ‘ort’.
    I hooked into em_register_form with the following:

    <?php 
    
    add_action('em_register_form','mycustomfields_em'); 
    
    function mycustomfields_em() {
    ?>
    	<p>
    		<label for='adresse'>Adresse</label>
    		<input id="adresse" class="input" type="text" size="25" value="<?php echo $_POST['adresse']; ?>" name="adresse" />
    	</p>
    	<p>
    		<label for='plz'>PLZ</label>
    		<input id="plz" class="input" style="max-width: 160px;" type="text" size="5" maxlength="5" value="<?php echo $_POST['plz']; ?>" name="plz" />
    	</p>
    	<p>
    		<label for='ort'>Ort</label>
    		<input id="ort" class="input" type="text" size="20" value="<?php echo $_POST['ort']; ?>" name="ort" />
    	</p>
    	<?php
    }
    
    ?>
    Plugin Support angelo_nwl

    (@angelo_nwl)

    this is already implemented at EMPro – https://wp-events-plugin.com/documentation/custom-booking-forms/

    Thread Starter moaschtr

    (@moaschtr)

    I know, thanks.

    If you’re accepting user input, you’d definitely want to take a look at the various sanitization functions WordPress provides to security check the user input.

    Thread Starter moaschtr

    (@moaschtr)

    Thanks caimin_nwl, that’s what I ment. I’ll have a look at those… hoped that maybe wordpress would do that automatically ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Additional custom booking fields’ is closed to new replies.