Support » Plugin: Post Expirator: Automatically Unpublish WordPress Posts » Set expiry date programmatically

  • Hello,

    We are using a tool to import Events. When importing, we would also like to set an expiry date. Is it possible to do this programmatically?

    Thanks in advance!
    -Kevin

    • This topic was modified 1 year, 3 months ago by kevinbrands.
Viewing 2 replies - 1 through 2 (of 2 total)
  • yes, this is the basic code for its:

    	$opts = array('expireType'=>"private", 'id'=>$post_id);
    	$ts = get_gmt_from_date("$year-$month-$day $hour:$minute:0",'U');
    	_scheduleExpiratorEvent($post_id,$ts,$opts);
    

    @tazir where should I paste the code from You to automatically set the expire date of posts?

    Dominic

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set expiry date programmatically’ is closed to new replies.