I am still not able to get this to work when adding a new post.
It looks like when I click Submit, the new post isn’t yet saved as a $post object, and I think this is why the redirect isn’t working.
I tried adding var_dump($post); in my custom redirect function and it shows “post_name”]=> string(8) “new-post”
and it also shows my post id is 109, which is the id of my new-post page, NOT the id of the new post I just submitted.
Shouldn’t this object show the information in the post I just submitted, and not the information about the Add new post page?
My permalinks are set up to be the post name not the id if that makes any difference.
Thank you for the help! I hope that made sense!