Don't show the view link for a future post unless the current user has the permissions to edit the post. Treat future posts as a preview case. Props ocean90. fixes #18894

git-svn-id: https://develop.svn.wordpress.org/trunk@19213 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-11-08 14:24:14 +00:00
parent fe2bd09613
commit aee3c7de59
1 changed files with 1 additions and 1 deletions

View File

@ -553,7 +553,7 @@ class WP_Posts_List_Table extends WP_List_Table {
$actions['delete'] = "<a class='submitdelete' title='" . esc_attr( __( 'Delete this item permanently' ) ) . "' href='" . get_delete_post_link( $post->ID, '', true ) . "'>" . __( 'Delete Permanently' ) . "</a>";
}
if ( $post_type_object->public ) {
if ( in_array( $post->post_status, array( 'pending', 'draft' ) ) ) {
if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
if ( $can_edit_post )
$actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink( $post->ID ) ) ) . '" title="' . esc_attr( sprintf( __( 'Preview &#8220;%s&#8221;' ), $title ) ) . '" rel="permalink">' . __( 'Preview' ) . '</a>';
} elseif ( 'trash' != $post->post_status ) {