Adding a new field for event submission form

Adding a country field for events

This tutorial shows how to edit fields based on the Editing Event Submission Form Fields doc and then output it on a single event listing.

 

Add the field to the frontend

Open up your theme functions.php field and create a function to append a new field to the events section. First hook it in:

Then write the function:

This adds a event text field at the bottom of the events form that has the label “Country”, is required, has no placeholder.

image missing

Fields added using the above code will be saved to the event listing automatically.

Add the field to admin

Again in theme functions.php, hook in your custom function:

Then write your custom function:

This add a text field to the admin meta box named “country”.

Image missing

Note, the field name is prepended with a ‘_’. This is because Event Manager makes your new fields hidden meta by prepending theme with an underscore. This is normal.