Support

Home Forums Event Espresso Premium Event Espresso Table Postponed Events

Event Espresso Table Postponed Events

Posted: April 24, 2019 at 10:39 am

Viewing 1 reply thread


Anthony Irtelli

April 24, 2019 at 10:39 am

Hi

I have added the shortcode [ESPRESSO_EVENTS_TABLE_TEMPLATE order_by=start_date table_search=false] but I notice that it shows events that have been postponed

Do you know if its possible to hide postponed events or do I need to edit the date under events settings.

Many thank

Mark


Josh

  • Support Staff

April 24, 2019 at 11:14 am

Hi,

You can remove the postponed events by adding the following code to your site:

function ee_event_list_removed_postponed(
    $SQL,
    WP_Query $wp_query
) {
    if ( 
        isset($wp_query->query_vars['post_type']) 
        && (
            $wp_query->query_vars['post_type'] == 'espresso_events'
            || (is_array( $wp_query->query_vars['post_type']) 
                && in_array(
                    'espresso_events',
                    $wp_query->query_vars['post_type']
                ) 
            ) 
        ) 
        && ! $wp_query->is_singular
    ) {
        $SQL .= ' AND post_status != "postponed"';
    }
    return $SQL;
}
add_filter('posts_where', 'ee_event_list_removed_postponed', 15, 2);

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

Viewing 1 reply thread

The support post ‘Event Espresso Table Postponed Events’ 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