From 0df30446838804a39e711b677706ed70a7915280 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 3 Sep 2014 11:32:52 +0000 Subject: [PATCH] Restore the post type's view_item label for preview links that don't submit the changes. fixes #28350. git-svn-id: https://develop.svn.wordpress.org/trunk@29695 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 6 +----- src/wp-includes/admin-bar.php | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 0a7e6dffb8..d230667c68 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1190,11 +1190,7 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { if ( current_user_can( 'read_post', $post->ID ) ) { $ptype = get_post_type_object( $post->post_type ); - if( 'draft' == $post->post_status ) { - $view_post = __( 'Preview' ); - } else { - $view_post = $ptype->labels->view_item; - } + $view_post = $ptype->labels->view_item; } if ( 'publish' == get_post_status( $post ) ) { diff --git a/src/wp-includes/admin-bar.php b/src/wp-includes/admin-bar.php index 0acefd07dc..cd1bb82a55 100644 --- a/src/wp-includes/admin-bar.php +++ b/src/wp-includes/admin-bar.php @@ -499,7 +499,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) { $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post ); $wp_admin_bar->add_menu( array( 'id' => 'preview', - 'title' => __( 'Preview' ), + 'title' => $post_type_object->labels->view_item, 'href' => esc_url( $preview_link ), 'meta' => array( 'target' => 'wp-preview-' . $post->ID ), ) );