Index: src/wp-admin/edit-form-advanced.php
===================================================================
--- src/wp-admin/edit-form-advanced.php	(revision 27471)
+++ src/wp-admin/edit-form-advanced.php	(working copy)
@@ -447,10 +447,6 @@
 <div class="inside">
 <?php
 $sample_permalink_html = $post_type_object->public ? get_sample_permalink_html($post->ID) : '';
-$shortlink = wp_get_shortlink($post->ID, 'post');
-$permalink = get_permalink( $post->ID );
-if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url('?page_id=' . $post->ID) )
-    $sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr($shortlink) . '" /><a href="#" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
 
 if ( $post_type_object->public && ! ( 'pending' == get_post_status( $post ) && !current_user_can( $post_type_object->cap->publish_posts ) ) ) {
 	$has_sample_permalink = $sample_permalink_html && 'auto-draft' != $post->post_status;
Index: src/wp-admin/includes/post.php
===================================================================
--- src/wp-admin/includes/post.php	(revision 27471)
+++ src/wp-admin/includes/post.php	(working copy)
@@ -1451,3 +1451,23 @@
 		return wp_create_post_autosave( $post_data );
 	}
 }
+
+/**
+ * Append the Get Shortlink button to the sample permalink HTML.
+ *
+ * This is attached to the 'sample_permalink_html' filter. Do not call this directly in plugins or theme templates.
+ *
+ * @uses get_sample_permalink_html()
+ *
+ * @return string The HTML of the sample permalink slug editor.
+ */
+function _get_sample_permalink_html_shortlink_button( $sample_permalink_html, $post_id, $new_title, $new_slug ) {
+	$shortlink = wp_get_shortlink( $post_id, 'post' );
+	$permalink = get_permalink( $post_id );
+
+	if ( !empty( $shortlink ) && $shortlink !== $permalink && $permalink !== home_url( '?page_id=' . $post_id ) ) {
+		$sample_permalink_html .= '<input id="shortlink" type="hidden" value="' . esc_attr( $shortlink ) . '" /><a href="#" class="button button-small" onclick="prompt(&#39;URL:&#39;, jQuery(\'#shortlink\').val()); return false;">' . __('Get Shortlink') . '</a>';
+	}
+
+	return $sample_permalink_html;
+}
\ No newline at end of file
Index: src/wp-includes/default-filters.php
===================================================================
--- src/wp-includes/default-filters.php	(revision 27471)
+++ src/wp-includes/default-filters.php	(working copy)
@@ -289,6 +289,9 @@
 // This option no longer exists; tell plugins we always support auto-embedding.
 add_filter( 'default_option_embed_autourls', '__return_true' );
 
+// Append shortlink to the slug display.
+add_filter( 'get_sample_permalink_html', '_get_sample_permalink_html_shortlink_button', 5, 4 );
+
 // Default settings for heartbeat
 add_filter( 'heartbeat_settings', 'wp_heartbeat_settings' );
 
