I have been able to set auto expire dates for a CPT (by updating '_cred_post_expiration_time') but I also need to set the new status of the post to private when the post expires.
Initial status is published.
How can I do that?
Solution:
I checked it and you can use the '_cred_post_expiration_time' to set the status of the CPT to draft, for example.
For example, you can add the following code where you're changing the expiration date and this should cause the effect you need:
// set expiration action to 'draft' status
$new_status_arr = array( 'post_status' => 'draft', 'custom_actions' => array() );
update_post_meta($post_id, '_cred_post_expiration_action', $new_status_arr);