Ticket #28350: 28350-2.patch
File 28350-2.patch, 1.5 KB (added by , 10 years ago) |
---|
-
wp-admin/includes/post.php
1179 1179 1180 1180 if ( current_user_can( 'read_post', $post->ID ) ) { 1181 1181 $ptype = get_post_type_object( $post->post_type ); 1182 $view_post = $ptype->labels->view_item; 1182 if( 'draft' == $post->post_status ) { 1183 $view_post = __( 'Preview' ); 1184 } else { 1185 $view_post = $ptype->labels->view_item; 1186 } 1183 1187 } 1184 1188 1185 1189 if ( 'publish' == get_post_status( $post ) ) { … … 1234 1238 $return .= '<span id="editable-post-name-full">' . $post_name . "</span>\n"; 1235 1239 1236 1240 if ( isset( $view_post ) ) { 1237 $return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n"; 1241 1242 if( 'draft' == $post->post_status ) { 1243 $preview_link = set_url_scheme( get_permalink( $post->ID ) ); 1244 /** This filter is documented in wp-admin/includes/meta-boxes.php */ 1245 $preview_link = esc_url( apply_filters( 'preview_post_link', add_query_arg( 'preview', 'true', $preview_link ) ) ); 1246 $return .= "<span id='view-post-btn'><a href='" . $preview_link . "' class='button button-small' target='_blank'>$view_post</a></span>\n"; 1247 } else { 1248 $return .= "<span id='view-post-btn'><a href='" . get_permalink( $post ) . "' class='button button-small'>$view_post</a></span>\n"; 1249 } 1238 1250 } 1239 1251 1240 1252 /** This filter is documented in wp-admin/includes/post.php */