Thanks to everyone who takes a look. I've spent countless hours trying to make this work, but no matter what I tried it still doesn't work. Hopefully I'm missing something simple, but I'm stuck...
Here's my code on the submit page where I add a new page and a cron job to delete it in the future:
$seconds = time() + $_POST["days"] * 86400;
wp_schedule_single_event($seconds, 'crondelete', $new_post_id );
And here's the relevant code in functions.php:
add_action( 'crondelete', 'delete_page_in');
function delete_page_in($args) {
wp_delete_post($args);
}
The cron part is working properly:
But it looks like the parameter isn't passed to the function, so once I run the cron job- nothing happens(the page won't delete).