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:
    [code lang=”php”]
    <?php
    add_filter( ‘submit_event_form_fields’,’frontend_add_facebook_field’ );
    ?>
    [/code]
  3. Write the function:
    [code lang=”php”]
    <?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;
    }

    ?>
    [/code]

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:
[code lang=”php”]
<?php
add_filter( ‘event_manager_event_listing_data_fields’, ‘admin_add_facebook_field’ );
?>
[/code]

Then write your custom function:

[code lang=”php”]
<?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;
}

?>
[/code]

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.

Remove existing field from event submission form
Ashok Dudhat

Our team constantly explores ways that technology can help us reinvent industries. We want to change the world by creating great products that transform industries. We Dream It, We Make It.

Was this article helpful?
1 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 100%
How can we improve this article?
How Can We Improve This Article?
Quick Links
Close
Close