Support

Home Forums Event Espresso Premium How can draft events be excluded from custom event table?

How can draft events be excluded from custom event table?

Posted: November 10, 2014 at 3:12 pm

Viewing 3 reply threads


Marcia Chadly

November 10, 2014 at 3:12 pm

Event Espresso version 3.1.36.5.P
WordPress version WP 4.0
Event Espresso – Calendar by Event Espresso version 2.2.4.p,
Event Espresso – Custom Template Display by Event Espresso version 1.0,
Event Espresso – MailChimp Integration by version 1.2,
Event Espresso – Multi Event Registration by Seth Shoultes version 1.0.5.p,
Event Espresso – Social Media by Event Espresso version 1.1.7.p,
Event Espresso by Event Espresso version 3.1.36.5.P,

I’m using the custom template display on this page: http://creativelifecenter.org/events/

Unfortunately, any event that is set as active is displayed in this list – including draft events. I want to not show draft events in this list.

Here is a portion of the code for the custom template. I tried to avoid the drafts using the $not_draft variable below. But both with and without using this variable, the drafts are shown if they are active.

$event_status = event_espresso_get_status($event->id);

$not_draft = true;
if ($event->event_status == “R”) {
$not_draft = false;
}

//Create an add to cart link
if ($event_status == ‘ACTIVE’ && $not_draft && empty($externalURL)) {…

What needs to be done? Thank you!


Lorenzo Orlando Caum

  • Support Staff

November 10, 2014 at 4:21 pm

Hi Marcia,

I wasn’t sure if you were aware but I thought I would mention this. Draft events will appear for event admins that are logged into your site. However, public visitors will not be able to view these events.

This should allow members of your team to create and edit events without public visitors seeing these events.


Lorenzo


Marcia Chadly

November 10, 2014 at 4:40 pm

Hi Lorenzo,

I wasn’t aware of that – perfect! Thanks.

Marcia


Lorenzo Orlando Caum

  • Support Staff

November 10, 2014 at 7:23 pm

You are welcome Marcia. If you need help with anything else, just create a new support post in our support forums:

https://eventespresso.com/support/forums/

Also, the draft status also applies for WP pages and posts. Public visitors can’t view those either but members of your team that are logged-in can.


Lorenzo

Viewing 3 reply threads

The support post ‘How can draft events be excluded from custom event table?’ 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