Support

Home Forums Event Espresso Premium Admin Columns plugin not working for EE

Admin Columns plugin not working for EE

Posted: January 12, 2016 at 5:04 am


Linda Isarasakdi

January 12, 2016 at 5:04 am

I was hoping to easily display custom fields on some EE admin screens, but when I installed the plugin Admin Columns, the EE custom post types are not available to edit.


Tony

  • Support Staff

January 12, 2016 at 5:10 am

Hi Linda,

Can I ask what you are trying to add?

There may be another way to work around this.


Linda Isarasakdi

January 12, 2016 at 6:28 pm

We’ve created some custom fields for our events and we’d like to be able to see them in the admin events listing screen. Searching by custom fields would also be handy, but I was thinking a sortable column may be enough.


Josh

  • Support Staff

January 13, 2016 at 8:38 am

Hi Linda,

It turns out there is a filter hook that lets you re-define how the EE event post type is registered. You can use the WordPress plugin API to hook in and change it so the post type will use the native WordPress admin menu routes. Here’s a readymade snippet:

add_filter( 'FHEE__EE_Register_CPTs__get_CPTs__cpts', 'dre_modify_visibility_of_event_espresso_cpt_in_admin' );
function dre_modify_visibility_of_event_espresso_cpt_in_admin( $cpt_registry_array ) {
    if ( isset( $cpt_registry_array['espresso_events'] ) ) {
        $cpt_registry_array['espresso_events']['args']['show_ui'] = true;
        $cpt_registry_array['espresso_events']['args']['show_in_menu'] = true;
    }
    return $cpt_registry_array;
}

You can add the above to a functions plugin or into your WordPress theme’s functions.php file.

Now there’s a few caveats to the above. You will now have two places where you can go to an event list table. The menu item that does not appear under Event Espresso will have the custom columns. The other caveat is the native WP admin route will have new columns that currently are not used (their features haven’t been baked, like Event Types). I can advise using the Admin Columns plugin to remove that column.


Linda Isarasakdi

January 28, 2016 at 9:22 am

Thanks, Josh, that code worked perfectly. And I’ve removed the sidebar submenu items so people don’t try to add events from that menu, and removed the Add New Event button at the top of the screen.

Only thing now is that WP by default is only showing Active events, while we need to show ALL events, past, present and future.

I’m digging around in the EE files to see how you’re displaying events and hopefully will pick up on a piece of coding to do that.


Josh

  • Support Staff

January 28, 2016 at 9:39 am

I believe those are custom post statuses.

The support post ‘Admin Columns plugin not working for EE’ 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