• Resolved fuzzylamp0433

    (@fuzzylamp0433)


    When adding a new event the field “_event_registration_email” defaults to the logged in users email address. How do I set a default value? I’d like to use a url as default, the booking link never changes.

    Can I assign default values for other event form fields?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rita Kikani

    (@kikanirita)

    Hi @fuzzylamp0433 ,

    You need to add below filter in your theme functions.php file to set default URL in registration email/url field :

    add_filter('submit_event_form_fields_get_user_data', 'set_event_form_fields_default_value', 10, 2);
    
    function set_event_form_fields_default_value($fields, $current_user_id){
    
    ? ? $fields['event']['event_registration_email']['value'] = 'YOUR_DEFAULT_URL';
    
    ? ? return $fields;
    
    }

    In above code, you have to pass the url link here ‘YOUR_DEFAULT_URL’ which you want to set as default value.

    Thank you.

    • This reply was modified 1 year, 7 months ago by Rita Kikani.
    Thread Starter fuzzylamp0433

    (@fuzzylamp0433)

    Thanks!

    I have the same problem. Unfortunately the code does not work for me, nothing changes. For me it would also be ok if there was no preset value in the field at all. Just the placeholder, that would be enough.

    Plugin Author Rita Kikani

    (@kikanirita)

    Hi @joehann ,

    If yo have issue with registration value in field-editor then please take v.3.1.38 from our git repository : https://github.com/wpeventmanager/wp-event-manager/tree/3_1_38

    You can use below code for your issue, cause in last release we update the “event_registration_email” with “registration” only.

    add_filter('submit_event_form_fields_get_user_data', 'set_event_form_fields_default_value', 10, 2);
    
    function set_event_form_fields_default_value($fields, $current_user_id){
    
    ? ? $fields['event']['registration']['value'] = 'YOUR_DEFAULT_URL';
    
    ? ? return $fields;
    
    }
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Change default Registration email/URL’ is closed to new replies.