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
- Open up your theme functions.php field.
- 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] - Write the function:
[code lang=”php”]
<?phpfunction 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.