Hide and Add column from the Event Dashboard

Hide and Add column from the Event Dashboard

An event dashboard displays all the details related to a specific event. A user can easily access the dashboard after  logging into his or her account on WP Event Manager. The event dashboard column can be seen directly in the home page. 

A user can hide or remove a field from the event dashboard page as per his or her requirements.

The user needs to follow the steps mentioned below to perform the task:

Hide Column

The following code has to be inserted in the Functions.php file of the child theme:

  1. add_action('event_manager_event_dashboard_columns','wpem_event_manager_event_dashboard_columns', 10, 3);         
  2.         function wpem_event_manager_event_dashboard_columns($columns)
  3.         {
  4.             unset($columns['view_count']);            
  5. return $columns;
  6. }

Let us take an example, say, as a user, you don’t want a field location on the dashboard.

Please enter the code:

  1. add_filter('event_manager_event_dashboard_columns','your_theme_name_event_dashboard');
  2. function your_theme_name_event_dashboard_columns($columns){
  3. unset($columns['event_location']);
  4. return $columns;
  5. }
  6. }

ADD Column

The following code has to be inserted in the Functions.php file of the child theme to add column:

  1. add_action('event_manager_event_dashboard_column_Your_array_key','your_theme_event_dashboard_value');
  2. function your_theme_event_dashboard_value($event ){
  3.  echo 'Custom column value here';
  4. }

Let us take an example, say, as a user, you want to add a field “Assigned To” as a Column heading and its value from meta_key “_organizer_email”.

Please enter the code:

  1. add_filter( 'event_manager_event_dashboard_columns', 'add_assign_to_columns' );
  2. function add_assign_to_columns( $columns )
  3. {
  4.     $columns['assign_to'] = __( 'Assign To', 'wp-event-manager' );
  5.     return $columns;
  6. } 
  7. add_action( 'event_manager_event_dashboard_column_assign_to', 'assign_to_column' );
  8. function assign_to_column( $event )
  9. {
  10.     global $post; 
  11.     echo get_post_meta($post->ID, '_organizer_email', true);
  12. }
    • Related Articles

    • Installation of WP Event Manager

      Automatic Installation of FREE WP Event Manager Installing WP Event Manager is just a matter of a few clicks. You can add WP Event Manager to your website by using the dashboard offered to you at the backend of the CMS. To install the plugin ...
    • Create or pick categories from Free/ Core WP Event manager

      Events are classified into various types based on the kind of visitors they have. Visitors come from different backgrounds. That is why an event organizer or admin must ensure that they make a lot of event categories available to their clients. This ...
    • Create or pick categories from Free/ Core WP Event manager

      Events are classified into various types based on the kind of visitors they have. Visitors come from different backgrounds. That is why an event organizer or admin must ensure that they make a lot of event categories available to their clients. This ...
    • Updating WP Event Manager

      Automatic Update WP Event Manager always strives to achieve perfection in every way and that is why we constantly update our plugins so that you can enjoy their innovative features. Here are the steps that you need to take to update WP Event Manager: ...
    • List of all the default template and fields given in core and Premium Add-ons

      The default templates offered by WP Event Manager are mentioned below. The default fields & default template available in the core plugin are as follows: WP-Event-Manager Account-signin.php Content-event_listing.php Content-no-events-found.php ...