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.
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.
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.
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.
Viewing 3 reply threads
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.
Support forum for Event Espresso 3 and Event Espresso 4.