• Resolved lunapartner

    (@lunapartner)


    Hi!

    It’s possible set as expire time the end date and end time?

    For example:
    An event start 29/07/2023 at 19:00 and end 31/07/2023 at 23:00

    Then it expires the day 31/07 at 23:00 o’clock. It’s possible?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Rita Kikani

    (@kikanirita)

    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 1 year, 3 months ago by Rita Kikani.
    • This reply was modified 1 year, 3 months ago by Rita Kikani.
    Thread Starter lunapartner

    (@lunapartner)

    It’s fine!

    Now I try to test the script.

    Thanks for support!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Expire Events at specific time’ is closed to new replies.