fbpx

How can we help?

Remove existing field from event submission form

Removing fields from events

This WP Event Manager tutorial shows how to remove existing fields from the event submission form. In this example, we have explained to you that how you can remove some social fields from the organizer section.

Remove existing field from the frontend event submission form

  1. Open up your theme functions.php field.
  2. Create a function to remove existing fields from the event submission form. First hook in it the following function:
    <?php
         add_filter( 'submit_event_form_fields','frontend_add_facebook_field' );
    ?>
    
  3. Write the function:
    <?php
    
    function frontend_add_country_field( $fields ) {
        unset( $fields['organizer']['organizer_linkedin'] );
        unset( $fields['organizer']['organizer_facebook'] );
        unset( $fields['organizer']['organizer_xing'] );
        unset( $fields['organizer']['organizer_pinterest'] );
        return $fields;
        }
    
    ?>
    

This will remove existing fields like LinkedIn, Facebook, ding, and Pinterest from the bottom of the frontend’s event submission form.

Remove the field from the backend event submission form

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

<?php
     add_filter( 'event_manager_event_listing_data_fields', 'admin_add_facebook_field' );
?>

Then write your custom function:

<?php

function frontend_add_facebook_field( $fields ) {
    unset( $fields['_organizer_linkedin'] );
    unset( $fields['_organizer_facebook'] );
    unset( $fields['_organizer_xing'] );
    unset( $fields['_organizer_pinterest'] );
    return $fields;
    }

?>

This will remove existing fields like LinkedIn, Facebook, xing, and Pinterest from the bottom of the backend’s event submission form.

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

Was this article helpful?
How can we improve this article?
Quick Links