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 9 months, 1 week 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);
    
    Dominic

    (@shifudominik)

    @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)
  • You must be logged in to reply to this topic.