Event End Date auto-expires Post (Hack :)
-
Hi Guido,
hope, you don’t mind!
I needed a workaround to expire dates automatically.
Paste this code in vsel.php on line 66function 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)
Viewing 1 replies (of 1 total)
- The topic ‘Event End Date auto-expires Post (Hack :)’ is closed to new replies.