Support

Home Forums Event Espresso Premium Adding columns to the Event Espresso > Event Overview in admin interface

Adding columns to the Event Espresso > Event Overview in admin interface

Posted: October 1, 2012 at 9:20 am


kromero

October 1, 2012 at 9:20 am

I’m looking into adding a column with custom data relating to an event in the list table on the Event Overview page in the WP admin interface. I don’t see any filters to accomplish this where the table is output ( event-espresso/includes/event-management/event-list.php:235 ). It seems like this page would benefit from using the WordPress core class WP_List_Table, and filters could be added as they are in WordPress core to allow for custom columns.

For now, I figure the way to do what I want is either add some jQuery after the table is already built, or build an entirely custom table view, which duplicates what EE does on the Event Overview page, just somewhere in a custom plugin of mine so as not to hack EE core.

Thoughts?


Josh

  • Support Staff

October 1, 2012 at 1:24 pm

Hi there,

If you can take a look at Event Espresso 3.2, you may notice that a lot of filters have been added to many of the admin screens. If there’s a point where you’d like to see a filter that you think will help with this use case, please let us know and we can work on adding it in.


kromero

October 8, 2012 at 7:48 am

Hi Josh,

after taking a look at the 3.2 Alpha, it appears no filters or actions have been added to assist with my issue (see includes/admin_screens/events/event_list.php functions espresso_event_list_header() and espresso_event_list_entry() ).

I’m still wondering if extending the WP_List_Table class might be a good solution here, as that has filters throughout it already made for this kind of thing.


Josh

  • Support Staff

October 9, 2012 at 4:46 am

You’re correct that there aren’t filters there, but there are many actions that can be hooked to. In this case, you could remove the above actions and replace them in your own custom plugin without hacking core. Here’s an example of how you could replace the header:

function your_custom_table_header() {
    //custom table header goes here
}

add_action('action_hook_espresso_event_list_header', 'your_custom_table_header', 11);

function remove_ee_event_list_header() {
remove_action('action_hook_espresso_event_list_header', 'espresso_event_list_header');
}
add_action('admin_init','remove_ee_event_list_header',11);

I’ll pass on your idea for using the WP_List_Tables class to the dev team, there may be some time before something like this makes it into the plugin though.

The support post ‘Adding columns to the Event Espresso > Event Overview in admin interface’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso