WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] Required Field (7 posts)

  1. bidum00
    Member
    Posted 1 year ago #

    How do I make the zipcode field a required field on the submit event page?

    http://wordpress.org/extend/plugins/events-manager/

  2. philipjohn
    Member
    Posted 1 year ago #

    Hiya,

    There's not actually an option for that I'm afraid.

    If you're comfortable with custom coding it might be do-able, though.

    Cheers

  3. bidum00
    Member
    Posted 1 year ago #

    If I was comfortable with coding surely I wouldn't be asking for help bro.
    I'm 100% sure it's do-able. Hopefully someone responds with the answer.

    Thanks for your reply though

    Cheers

  4. caimin_nwl
    NetWebLogic Support
    Posted 1 year ago #

    What Phil means is that the only way to do it would be with custom coding - there's no option for it in the interface.

  5. bidum00
    Member
    Posted 1 year ago #

    Wow, ok so what's the custom code to make my zip code field required during the submit an event process?

  6. angelo
    NetWebLogic Support
    Posted 1 year ago #

    you can try to hook into em_location_validate filter - something like this in your theme functions.php

    function my_em_mod_location($result, $EM_Location){
    	if( empty($EM_Location->location_postcode) ){
    		$result = false;
    		$EM_Location->add_error( __("zipcode is required.", "dbem") );
    	}
    }
    add_filter('em_location_validate','my_em_mod_location',10,2);
  7. bidum00
    Member
    Posted 1 year ago #

    angelo_nwl: your code works, your the flippin man, thank you

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags