Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am trying to change the link of the "View Post" button that appears next to the "Change Permalinks" button above the editor on post edit screens for a custom post type.

I have altered all the messages when a post is updated, published etc. but cannot figure out how to alter the button link. I'll need to do this for the "Preview" button as well. The custom post type is not publicly queryable so I need my client to be able to click these buttons and be taken to the page that displays this custom post type (using a page template).

Any and all help is appreciated!

share|improve this question

1 Answer 1

»View Post« Button

There's a filter that you can use with a simple str_replace. Not the best solution, but there's no other one:

apply_filters('get_sample_permalink_html', $return, $id, $new_title, $new_slug)

»Preview« Button

For the »Preview« Text, there's not filter (only for the link target), but you can take a look at this Answer by @toscho on how to use the gettext filters for that.

share|improve this answer

Your Answer

 
discard

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.