Show the permalink even when not "pretty" and add "View Post" button if the post is published, see #8976

git-svn-id: https://develop.svn.wordpress.org/trunk@10458 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-01-29 12:11:52 +00:00
parent d7acc77238
commit 29c8718141
3 changed files with 39 additions and 8 deletions
+10 -3
View File
@@ -88,9 +88,16 @@ function post_submit_meta_box($post) {
</div>
<div id="preview-action">
<?php $preview_link = 'publish' == $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)))); ?>
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php _e('Preview'); ?></a>
<?php
if ( 'publish' == $post->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');
}
?>
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php echo $preview_button; ?></a>
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
</div>