Restore the post type's view_item label for preview links that don't submit the changes.

fixes #28350.
Built from https://develop.svn.wordpress.org/trunk@29695


git-svn-id: http://core.svn.wordpress.org/trunk@29470 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-09-03 11:33:16 +00:00
parent de59e21b62
commit 2ff943b7b0
2 changed files with 2 additions and 6 deletions

View File

@ -1190,12 +1190,8 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
if ( current_user_can( 'read_post', $post->ID ) ) { if ( current_user_can( 'read_post', $post->ID ) ) {
$ptype = get_post_type_object( $post->post_type ); $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 ) ) { if ( 'publish' == get_post_status( $post ) ) {
$title = __('Click to edit this part of the permalink'); $title = __('Click to edit this part of the permalink');

View File

@ -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 ); $preview_link = apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ), $post );
$wp_admin_bar->add_menu( array( $wp_admin_bar->add_menu( array(
'id' => 'preview', 'id' => 'preview',
'title' => __( 'Preview' ), 'title' => $post_type_object->labels->view_item,
'href' => esc_url( $preview_link ), 'href' => esc_url( $preview_link ),
'meta' => array( 'target' => 'wp-preview-' . $post->ID ), 'meta' => array( 'target' => 'wp-preview-' . $post->ID ),
) ); ) );