WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I can't seem to find this anywhere, Is there a way to retrieve the URL of the post (which is of a custom post type) you are editing. Basically I want to somehow get the same URL that shows up like this: Permalink: (link to post) on the edit screen.

share|improve this question
Did you mean add the link in the admin panel for editing posts? There should be a view post link there already. – miahelf Oct 13 '12 at 6:17
up vote 0 down vote accepted

You should have the $post variable (you may need global $post;) from which you can get the post ID ($post->ID). Then $perm = get_permalink( $post->ID ); should give you what you want.


share|improve this answer
Thanks! Had to use $global for those future viewers :) – Chris Oct 13 '12 at 12:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.