Support

Home Forums Event Espresso Premium List view, determine if Ticket Selector set to be shown or not

List view, determine if Ticket Selector set to be shown or not

Posted: October 30, 2020 at 9:01 am


Antenna Digital

October 30, 2020 at 9:01 am

I’m using the following to create a query of events.
$wp_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery( $atts );

This is working as expected and I’m able to loop through the resulting post objects and have a nice list of events.

I’m using <?php the_permalink(); ?> to output a link to the Event’s detail page.

I would like to not show that link if the event in question has “Display Ticket Selector” set to NO.

I use this snippet to get the first datetime for the event
$x = $post->EE_Event->first_datetime();

But can’t figure out how to get this value from the post object
[“EVT_display_ticket_selector”]=> string(1) “1”

The following does not work for me
$post->EE_Event->EVT_display_ticket_selector

Any suggestions?
Thanks


Tony

  • Support Staff

October 30, 2020 at 9:31 am

Hi there,

You can use the display_ticket_selector() method on the EE_Event object.

So something like:

if( $post->EE_Event->display_ticket_selector() ) {
    // Display the ticket selector.
}

I highly recommend you take a look at our model system docs:

https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System

The methods provided within the models give you access to pretty much anything you would need within EE and also allow you to pull in related data relatively easily.

The support post ‘List view, determine if Ticket Selector set to be shown or not’ 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