Have you tried wp_trash_post?
This seems like the perfect fit for your purpose. It will only permanently delete posts if you have your trash disabled, or added define('EMPTY_TRASH_DAYS', 0);
to your wp-config.php file.
Have you tried wp_trash_post?
This seems like the perfect fit for your purpose. It will only permanently delete posts if you have your trash disabled, or added define('EMPTY_TRASH_DAYS', 0);
to your wp-config.php file.