Title: [Plugin: Events Manager] Export role in CSV
Last modified: August 20, 2016

---

# [Plugin: Events Manager] Export role in CSV

 *  Resolved [paulverhulst](https://wordpress.org/support/users/paulverhulst/)
 * (@paulverhulst)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/)
 * Hello,
 * I was wondering if it is possible to add the user Role to a CSV export?
 * When you look at an users profile, you can see phone data. Next to this information
   shows the italic word: _(Events Manager)_, wich gives me the information that
   i can export this data.
 * Can someone help me to export the user Role data?
 * Kind regards,
 * Paul
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Thread Starter [paulverhulst](https://wordpress.org/support/users/paulverhulst/)
 * (@paulverhulst)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018049)
 * I found the file which i have to edit. It’s the em-bookings-table.php.
    Here’s
   a list of data you can export:
 * $this->cols_template = apply_filters(’em_bookings_table_cols_template’, array(
   ‘
   user_name’=>__(‘Name’,’dbem’), ‘event_name’=>__(‘Event’,’dbem’), ‘event_date’
   =>__(‘Event Date(s)’,’dbem’), ‘event_time’=>__(‘Event Time(s)’,’dbem’), ‘user_email’
   =>__(‘E-mail’,’dbem’), ‘dbem_phone’=>__(‘Phone Number’,’dbem’), ‘booking_spaces’
   =>__(‘Spaces’,’dbem’), ‘booking_status’=>__(‘Status’,’dbem’), ‘booking_date’=
   >__(‘Booking Date’,’dbem’), ‘role’=>__(‘Role’,’dbem’),
 * When i replace the last line (see above) it shows in the export settings, but
   the export don’t give me the information. (the title Role shows in the export,
   but the cells are empty)
 * Anyone know how to fix this?
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018054)
 * can I know what do you mean by user Role?
 *  Thread Starter [paulverhulst](https://wordpress.org/support/users/paulverhulst/)
 * (@paulverhulst)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018058)
 * Sure,
 * When people subscribe to the site, you can give them a role, such as: subscriber,
   editor, etc.
    You can see it when you to to users, and select one.
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018062)
 * try to see function get_row() then add a new `else if` and then add a function
   similar to this [http://wordpress.org/support/topic/get-a-users-role-by-user-id?replies=20](http://wordpress.org/support/topic/get-a-users-role-by-user-id?replies=20)
 * note: this is not update safe OR try to hook into em_bookings_table_rows_col_*
   filter instead (below function get_row())
 *  Thread Starter [paulverhulst](https://wordpress.org/support/users/paulverhulst/)
 * (@paulverhulst)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018104)
 * Hmm..
    Maybe this is too difficult for me..
 * I tried to replace ‘dbem_phone’ with ‘role’.
    This looks like:
 * L83: ‘role’=>__(‘Role’,’dbem’),
    L521: }elseif($col == ‘role’){ L522: $cols[]
   = $EM_Booking->get_person()->role;
 * But this won’t work.
    I don’t know what they are talking about in the link you
   send me. It’s not in php, is it?
 * (thanks for the quick response)
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018254)
 * Yes, it’s a bit more complicated than that. First, you’d need to add some more
   php there to get the role of the user than what you did on l522
 * also, you should be using the filter provided around those lines to add new collumns(
   that’s what we do in Pro for example)
 *  Thread Starter [paulverhulst](https://wordpress.org/support/users/paulverhulst/)
 * (@paulverhulst)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018328)
 * Hi all,
 * I was wondering if someone knows an easier solution for my problem?
    There has
   to be an easier solution, because telephone numbers can be exported.
 * Can someone help me please?
 * KR, Paul
 *  Thread Starter [paulverhulst](https://wordpress.org/support/users/paulverhulst/)
 * (@paulverhulst)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018327)
 * Hi all,
 * I was wondering if someone knows an easier solution for my problem?
    There has
   to be an easier solution, because telephone numbers can be exported.
 * Can someone help me please?
 * KR, Paul
 *  Plugin Author [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * (@netweblogic)
 * [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018330)
 * you need to code in some hooks to add new data, that’s the easiest way.
 * it’s all done in classes/em-bookings-table.php, particularly in __construct and
   get_rows()
 * in __construct, you hook into the booking_actions table and add to $this->cols
   and $this->cols_template
 * and then in get_rows you hook into this bit here:
    `$val = apply_filters('em_bookings_table_rows_col_'.
   $col, '', $EM_Booking, $this, $csv);`
 * where $col would be that which you added in $this->cols above.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘[Plugin: Events Manager] Export role in CSV’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=1039078)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

## Tags

 * [csv](https://wordpress.org/support/topic-tag/csv/)
 * [export](https://wordpress.org/support/topic-tag/export/)

 * 9 replies
 * 3 participants
 * Last reply from: [Marcus (aka @msykes)](https://wordpress.org/support/users/netweblogic/)
 * Last activity: [13 years, 6 months ago](https://wordpress.org/support/topic/plugin-events-manager-export-role-in-csv/#post-3018330)
 * Status: resolved