I have this function where I call a custom function through the add_action hook:
add_action('publish_post', 'custom_function');
... now it works perfectly, but the I want the custom_function to be delayed so it runs AFTER the post has been published.
BUT, if I add sleep(20)
inside the custom_function
it delays the post itself. What I want is the post to be published, and THEN run this function after x seconds.
Thanks!