diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php
index ae33a25835..5599481db0 100644
--- a/wp-admin/edit-form-advanced.php
+++ b/wp-admin/edit-form-advanced.php
@@ -88,9 +88,16 @@ function post_submit_meta_box($post) {
-post_status ? clean_url(get_permalink($post->ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>
-
-
+post_status ) {
+ $preview_link = clean_url(get_permalink($post->ID));
+ $preview_button = __('Preview Changes');
+} else {
+ $preview_link = clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
+ $preview_button = __('Preview');
+}
+?>
+
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php
index 5d1caea078..18658044ef 100644
--- a/wp-admin/edit-page-form.php
+++ b/wp-admin/edit-page-form.php
@@ -80,9 +80,16 @@ function page_submit_meta_box($post) {
-post_status ? clean_url(get_permalink($post->ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>
-
-
+post_status ) {
+ $preview_link = clean_url(get_permalink($post->ID));
+ $preview_button = __('Preview Changes');
+} else {
+ $preview_link = clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID))));
+ $preview_button = __('Preview');
+}
+?>
+
diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php
index 5b2874825d..6e719ef67c 100644
--- a/wp-admin/includes/post.php
+++ b/wp-admin/includes/post.php
@@ -946,9 +946,21 @@ function get_sample_permalink($id, $title=null, $name = null) {
function get_sample_permalink_html($id, $new_title=null, $new_slug=null) {
$post = &get_post($id);
list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
- if (false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%')) {
- return '';
+ if ( 'publish' == $post->post_status )
+ $view_post = 'post' == $post->post_type ? __('View Post') : __('View Page');
+
+ if ( false === strpos($permalink, '%postname%') && false === strpos($permalink, '%pagename%') ) {
+ if ( 'page' == $post->post_type )
+ return '';
+
+ $return = '' . __('Permalink:') . "\n" . '' . $permalink . "\n";
+ $return .= '' . __('Change Permalinks') . "\n";
+ if ( isset($view_post) )
+ $return .= "$view_post\n";
+
+ return $return;
}
+
$title = __('Click to edit this part of the permalink');
if (function_exists('mb_strlen')) {
if (mb_strlen($post_name) > 30) {
@@ -963,10 +975,15 @@ function get_sample_permalink_html($id, $new_title=null, $new_slug=null) {
$post_name_abridged = $post_name;
}
}
+
$post_name_html = ''.$post_name_abridged.''.$post_name.'';
$display_link = str_replace(array('%pagename%','%postname%'), $post_name_html, $permalink);
+ $view_link = str_replace(array('%pagename%','%postname%'), $post_name, $permalink);
$return = '' . __('Permalink:') . "\n" . '' . $display_link . "\n";
$return .= '' . __('Edit') . "\n";
+ if ( isset($view_post) )
+ $return .= "$view_post\n";
+
return $return;
}