Contact Organizer
The Contact Organizer plugin works as a bridge between the event organizers and attendees. Users can create a Contact Organizer form with the plugin through which attendees can directly get in touch with the organizer.
Installing the plugin
The installation process is the same for all the addons, offered by WP Event Manager. They can be both installed automatically and manually.
- Automatic Installation: You can install the plugin from the backend of your WordPress. Click Here to see how you can install the plugin automatically.
- Manual Installation: You can also install the plugin manually using SFTP or FTP tools. Click Here to see how you can install the plugin manually.
Watch this video for more clarification.
The Contact Organizer Form
After installing and activating the plugin, you will see a Contact Organizer button at the right side of the event detail page. You need to click on the Contact Organizer button to get the Contact organizer form as shown in the picture below:
Customization: Managing the Contact Organizer Button & Contact Form Place
- The contact organizer form is hooked into the event page after the event meta place as shown below:
<?php add_action( 'single_event_listing_button_end', array( $this, 'contact_organizer_form' ) ); ?>
- To remove and move it to a different place, you can do like this:
<?php /** * Move my contact organizer message place to the perfect place. * Show my contact organizer message after button section that way we have hooked 'single_event_listing_button_end' hook and it will show at after button section. * @param array $steps * @return array * @since 1.0.0 */ function move_message_and_action_button() { global $event_manager_contact_organizer; if ( has_action('single_event_listing_button_end', array( $event_manager_contact_organizer, 'contact_organizer_form' )) ) { remove_action( 'single_event_listing_button_end', array( $event_manager_contact_organizer, 'contact_organizer_form' ) ); } if ( has_action('single_event_listing_button_end', array( $event_manager_contact_organizer, 'contact_organizer_form'))) { remove_action( 'single_event_listing_button_end', array( $event_manager_contact_organizer, 'contact_organizer_form' ) ); add_action( 'single_event_listing_button_end', array( $event_manager_contact_organizer, 'contact_organizer_form' ) ); } else { add_action( 'single_event_listing_button_end', array( $event_manager_contact_organizer, 'contact_organizer_form' ) ); } } add_action( 'wp', 'move_message_and_action_button', 12 ); ?>
- In General, You can use your choice of the custom hook to add the form to a different place.
<?php global $event_manager_contact_organizer; add_action( 'your_custom_hook', array( $event_manager_contact_organizer, 'contact_organizer_form') ); ?>
Customization: Add or Edit Contact Organizer Form Fields
You can customize fields in the Contact Organizer form by adding the following filters:
<?php add_filter('contact_organizer_form_fields','add_custom_field_to_cgf'); function add_custom_field_to_cgf($fields){ //udpate existing fields $fields['contact_person_name']['label'] =__( 'Name label changed', 'wp-event-manager-contact-organizer' ); //add new field $fields['contact_custom_name'] = array( 'label'=>__( 'custom Name', 'wp-event-manager-contact-organizer' ), 'default' => '', 'type' => 'text', 'required'=>true, 'placeholder' => __( 'Please enter custom name', 'wp-event-manager-contact-organizer' ), 'priority' => 1 ); return $fields; } ?>
Customization: Overriding/Customizing the Template Files
For overriding or customization, the template files can be found in the wp-event-manager-contact-organizer/templates/ directory.
To override a template file, you need to follow the below mentioned steps.
- Create directory “wp-event-manager-contact-organizer” under your theme folder
- copy the template file to “/wp-content/yourtheme/wp-event-manager-contact-organizer/” directory.
- Your theme will use all the template files from the “/wp-content/yourtheme/wp-event-manager-contact-organizer/” directory instead of the plugin’s template file (/wp-content/plugins/wp-event-manager-contact-organizer/).
- contact-organizer.php – generates contact form.
- content-contact-organizer-email.php – sends mail to organizer.
Remember: If you have overrided template file and plugin frequently updating then you need to sync template file with new updates from the plugin’s template file for better functionality and new features.