call get_permalink with a post_id parameter if post context has been already established
Merge pull request #453 from niallkennedy/permalink-post-id

call get_permalink with a post_id parameter if post context exists