Support

Home Forums Event Espresso Premium Event Admin Table List

Event Admin Table List

Posted: November 22, 2016 at 6:49 am


bewegt

November 22, 2016 at 6:49 am

Im trying to add a custom column to the event list.
I created the column but I can’t get the content.

This is how my code looks like:

function bs_event_table_head( $defaults ) {
    $defaults['kurs']  = 'Kurs';
    return $defaults;
}
add_filter('FHEE_manage_toplevel_page_espresso_events_columns', 'bs_event_table_head');
function bs_event_table_content( $column_name, $post_id ) {
	echo get_post_meta( $post_id, 'meta-box-text', true );
}
add_action( 'AHEE__EE_Admin_List_Table__column_kurs__toplevel_page_espresso_events', 'bs_event_table_content', 10, 2 );

Thanks for your help!


Josh

  • Support Staff

November 22, 2016 at 12:49 pm

Hi there,

Looks like the main thing is you need to pass the $event object to your function that displays the content in the rows, then use the $event object to get the event ID. Here’s a link to a gist that shows an example:

https://gist.github.com/joshfeck/7bfda95067ceb6f5b52ab271411a8eb2


bewegt

November 23, 2016 at 1:41 am

Awesome that worked perfectly.
Thanks a lot

The support post ‘Event Admin Table List’ 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