diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index ef2ccb398..5106c2ea3 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -243,12 +243,12 @@ $side_meta_boxes = do_meta_boxes($post_type, 'side', $post);
ID);
+$sample_permalink_html = ! empty( $post_type_object->publicly_queryable ) ? get_sample_permalink_html($post->ID) : '';
$shortlink = wp_get_shortlink($post->ID, 'post');
if ( !empty($shortlink) )
$sample_permalink_html .= '
' . __('Get Shortlink') . '';
-if ( !( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
+if ( ! empty( $post_type_object->publicly_queryable ) && ! ( 'pending' == $post->post_status && !current_user_can( $post_type_object->cap->publish_posts ) ) ) { ?>
ID) && ! empty($sample_permalink_html) && 'auto-draft' != $post->post_status )