call get_permalink with a post_id parameter if post context exists

pass `post_id` to [get_permalink](http://codex.wordpress.org/Function_Reference/get_permalink) if we already have the context