Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i try to build a form that users posts from frontend, everything works fine but i need to know if it's possible, if i play with the 'post_date' => date('Y-m-d H:i:s')?

if i add a hidden field that generates the expiration day (+30 days from the post day) and then add it to the post with add_post_meta($post_id, 'expiration', $expDate, true);

anyone have any ideas how i can build something like this?

thanks a lot,
Philip

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

The post by itself is only data, it cannot perform such action as expiring itself. So you need some form of external control to act on it.

You can use WP Cron (see wp_schedule_event() and related) to run periodic task that will query for posts by your custom field and perform wanted action on them (trashing, cancelling published status, etc).

share|improve this answer
    
Thanks @Rarst, i will take a deep look to the Cron! –  Philip Jan 10 '11 at 8:42
    
@Philip: I'm very curious about this, could you share some code you've written? –  vdboor Jul 7 '11 at 21:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.