• Using this code to set expiry on a WooCommerce product

    $expire_date = '2020-10-01 00:00:00';
    $ts = get_gmt_from_date($expire_date,'U');
    $opts = array();
    $opts['expireType'] = 'delete';
    $opts['id'] = $result->id;
    _scheduleExpiratorEvent($result->id, $ts, $opts);

    When viewing the product in WordPress, Post Expirator panel shows 2020 January 01 and October is missing from the dropdown: https://imgur.com/a/Q4oBNVg

    This means if the user saves the product without correcting the date fields on Post Expirator the post is deleted immedately.

    I checked the postmeta and the timestamp is correct. I created a test product using the WordPress inteface and the postmeta is identical to the postmeta when set using PHP.

    Any ideas?

  • The topic ‘Using _scheduleExpiratorEvent() and interface is broken’ is closed to new replies.