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!
»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:»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.