Support

Home Forums Event Espresso Premium Change Ticket Selector Shortcode Output (For expired events)

Change Ticket Selector Shortcode Output (For expired events)

Posted: June 14, 2018 at 11:20 am


KZNTR

June 14, 2018 at 11:20 am

Hi guys!

We are looking for a way to change the “View Details” button that appears on a ticket selector when the associated event has expired.

All we want it to say is “Online Entries Closed”

Thanks a lot


KZNTR

June 14, 2018 at 11:22 am

Oh I forgot to mention we do not need it to link to any page. Simply display an “Entries Closed” notification. We don’t want users to get redirected to the EE event page.


Josh

  • Support Staff

June 14, 2018 at 2:01 pm

You can use the available filter hooks to change those. e.g.

add_filter(
    'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text',
    'my_custom_view_details_text_expired_events',
    10,
    2
);
function my_custom_view_details_text_expired_events($text, $event) {
    if($event instanceof EE_Event){
        if($event->get_active_status()=='DTE') {
            $text = 'Online Entries Closed'; 
        }
    }
    return $text;
}

add_filter(
    'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_url',
    'my_custom_view_details_url_expired_events',
    10,
    2
);
function my_custom_view_details_url_expired_events($url, $event) {
    if($event instanceof EE_Event){
        if($event->get_active_status()=='DTE') {
            $url = ''; 
        }
    }
    return $url;
}

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

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: publish

Updated by  Josh 1 week, 2 days ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!