• Resolved thcarblov

    (@thcarblov)


    Hi Guido,

    hope, you don’t mind!

    I needed a workaround to expire dates automatically.
    Paste this code in vsel.php on line 66

    function change_post_status($post_id,$status){
        $current_post = get_post( $post_id, 'ARRAY_A' );
        $current_post['post_status'] = $status;
        wp_update_post($current_post);

    then call the function on line 93

    $end_date = get_post_meta( $post->ID, 'event-date', true );
    if ( $end_date > time() ) { change_post_status($post_id,'draft'); }

    Funny, but it works.

Viewing 1 replies (of 1 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi,

    Don’t mind ??

    So with this hack an event is not listed in frontend anymore if (end) date “expires”.. you change post status from published to draft. That should work just fine I guess.

    Guido

Viewing 1 replies (of 1 total)
  • The topic ‘Event End Date auto-expires Post (Hack :)’ is closed to new replies.