fbpx

How can we help?

Changing the priority of field for event submission form

Changing the priority of field like country field for events

This tutorial will show you how you can edit fields with the Editing Event Submission Form Fields doc and display it on a single event listing.

Changing the priority of field for the frontend’s event submission form

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

    add_filter( 'submit_event_form_fields', 'frontend_add_country_field' );

Then write the function:

  
  function frontend_add_country_field( $fields ) {
  $fields['event']['event_country'] = array(
    'label'       => __( 'Country ($)', 'event_manager' ),
    'type'        => 'text',
    'required'    => true,
    'priority'    => 2 ,
    'placeholder' => 'e.g. germmany'
  );
  return $fields;
}

This change the priority of field for an event field priority of the frontend events form that has the label “Country”, is required, priority has 2.

Changing the field’s priority of the the backend’s event submission form

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

     add_filter( 'event_manager_event_listing_data_fields', 'admin_add_country_field' );

Then write your custom function:


function admin_add_country_field( $fields ) {
  $fields['_event_country'] = array(
    'label'       => __( 'Country ($)', 'event_manager' ),
    'type'        => 'text',
    'placeholder' => 'e.g. germmany',
    'priority'    => 2 ,
    'description' => ''
  );
  return $fields;
}

Was this article helpful?
How can we improve this article?
How Can We Improve This Article?
Quick Links
Close