Editor: Show 'View Post' for any post the author can read.

This expands it to private posts and matches the logic in the toolbar.

props mordauk, SergeyBiryukov.
fixes #27059.


git-svn-id: https://develop.svn.wordpress.org/trunk@27483 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2014-03-09 13:52:08 +00:00
parent 292f70aba3
commit e4bb7b0e8c

View File

@ -1049,9 +1049,12 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
if ( 'publish' == get_post_status( $post ) ) { if ( current_user_can( 'read_post', $post->ID ) ) {
$ptype = get_post_type_object($post->post_type); $ptype = get_post_type_object( $post->post_type );
$view_post = $ptype->labels->view_item; $view_post = $ptype->labels->view_item;
}
if ( 'publish' == get_post_status( $post ) ) {
$title = __('Click to edit this part of the permalink'); $title = __('Click to edit this part of the permalink');
} else { } else {
$title = __('Temporary permalink. Click to edit this part.'); $title = __('Temporary permalink. Click to edit this part.');