Support

Home Forums Event Espresso Premium ESPRESSO_TABLE — don't want t oshow events where reg has expired

ESPRESSO_TABLE — don't want t oshow events where reg has expired

Posted: February 8, 2016 at 12:08 pm


Elaine Wildash

February 8, 2016 at 12:08 pm

Hi,

EE3 ESPRESSO_TABLE

Is there anyway to stop events which haven’t yet taken place but where the registration dates are passed from displaying in the table?

Thanks,

Elaine


Elaine Wildash

February 9, 2016 at 4:34 am

Hi,

Sorry to chase – but any ideas on this?

Elaine


Josh

  • Support Staff

February 9, 2016 at 11:37 am

Hi Elaine,

The change you want to make involves making a change to the query. You’ll find the query broken out into parts in the main index.php file of the Custom Templates add-on. One place that will work to change the query is on line 177 where it has this:

$sql .= $show_expired == 'false' ? " AND (e.start_date >= '" . date('Y-m-d') . "' OR e.event_status = 'O' OR e.registration_end >= '" . date('Y-m-d') . "') " : '';

You can change it to this:

$sql .= $show_expired == 'false' ? " AND (e.registration_end >= '" . date('Y-m-d') . "') " : '';

The you make sure to include the show_expired parameter in the shortcode on the page like this:

[EVENT_CUSTOM_VIEW show_expired=false]

Finally, you’ll note that the above change could get wiped out on an update, in the event that Custom Table add-on for EE3 does ever get updated again. It’s not likely it will, but if you know how to use the add_action() and remove_action() WordPress functions, you can unhook the espresso_custom_template_display() function and hook in your own custom function to replace it.

The support post ‘ESPRESSO_TABLE — don't want t oshow events where reg has expired’ 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