Expire Events at specific time

[ad_1]

Hi @lunapartner ,

Yes, this is possible to set event expire date-time same as event end date-time. We have filter to customize event expire date-time.

You need to add below code in your theme functions.php file to achieve this functionality.

add_filter('wpem_expire_date_time', 'wpem_change_expire_date_time', 10, 2);

function wpem_change_expire_date_time($expire_date, $event){

    //this will return event expire date and time

    return $event->_event_end_date;

}

add_filter('wpem_get_current_expire_time', 'get_current_date_time');

function get_current_date_time($date){

    //this will return your current date and time

    // pass your timezone here

    date_default_timezone_set('Asia/Kolkata');

    return date("Y-m-d H:i:s");

}

You need to pass your country time zone to get current date-time to expire event on exact time.

If you want to know more information, then please read from here : https://github.com/wpeventmanager/wp-event-manager/issues/1449

I hope that this code will help to resolve your query.If you need any further assistance then let us know.

Thank you.

  • This reply was modified 3 hours, 16 minutes ago by Rita Kikani.
  • This reply was modified 2 hours, 37 minutes ago by Rita Kikani.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer