get_post_permalink won’t work for draft or pending posts. But there are a couple workarounds you could use.
Here there is a similar post with two options.
get_post_permalink won’t work for draft or pending posts. But there are a couple workarounds you could use.
Here there is a similar post with two options.