mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@27483 git-svn-id: http://core.svn.wordpress.org/trunk@27327 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3e356d7bdf
commit
de769c267f
@ -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);
|
||||
|
||||
if ( 'publish' == get_post_status( $post ) ) {
|
||||
$ptype = get_post_type_object($post->post_type);
|
||||
if ( current_user_can( 'read_post', $post->ID ) ) {
|
||||
$ptype = get_post_type_object( $post->post_type );
|
||||
$view_post = $ptype->labels->view_item;
|
||||
}
|
||||
|
||||
if ( 'publish' == get_post_status( $post ) ) {
|
||||
$title = __('Click to edit this part of the permalink');
|
||||
} else {
|
||||
$title = __('Temporary permalink. Click to edit this part.');
|
||||
|
Loading…
Reference in New Issue
Block a user