Make WordPress Core

Ticket #13301: 13301.patch

File 13301.patch, 3.5 KB (added by johnbillion, 16 years ago)
  • wp-admin/includes/template.php

     
    13591359                                if ( 'trash' == $post->post_status || !EMPTY_TRASH_DAYS )
    13601360                                        $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this post permanently')) . "' href='" . get_delete_post_link($post->ID, '', true) . "'>" . __('Delete Permanently') . "</a>";
    13611361                        }
    1362                         if ( in_array($post->post_status, array('pending', 'draft')) ) {
    1363                                 if ( current_user_can($post_type_object->edit_cap, $post->ID) )
    1364                                         $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($post->ID) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    1365                         } elseif ( 'trash' != $post->post_status ) {
    1366                                 $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
     1362                        if ( $post_type_object->publicly_queryable ) {
     1363                                if ( in_array($post->post_status, array('pending', 'draft')) ) {
     1364                                        if ( current_user_can($post_type_object->edit_cap, $post->ID) )
     1365                                                $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($post->ID) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1366                                } elseif ( 'trash' != $post->post_status ) {
     1367                                        $actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
     1368                                }
    13671369                        }
    13681370                        $actions = apply_filters('post_row_actions', $actions, $post);
    13691371                        $action_count = count($actions);
     
    15811583                        if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS )
    15821584                                $actions['delete'] = "<a class='submitdelete' title='" . esc_attr(__('Delete this page permanently')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=delete&amp;post=$page->ID", 'delete-' . $post->post_type . '_' . $page->ID) . "'>" . __('Delete Permanently') . "</a>";
    15831585                }
    1584                 if ( in_array($post->post_status, array('pending', 'draft')) ) {
    1585                         if ( current_user_can($post_type_object->edit_cap, $page->ID) )
    1586                                 $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($page->ID) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
    1587                 } elseif ( $post->post_status != 'trash' ) {
    1588                         $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
     1586                if ( $post_type_object->publicly_queryable ) {
     1587                        if ( in_array($post->post_status, array('pending', 'draft')) ) {
     1588                                if ( current_user_can($post_type_object->edit_cap, $page->ID) )
     1589                                        $actions['view'] = '<a href="' . add_query_arg( 'preview', 'true', get_permalink($page->ID) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>';
     1590                        } elseif ( $post->post_status != 'trash' ) {
     1591                                $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>';
     1592                        }
    15891593                }
    15901594                $actions = apply_filters('page_row_actions', $actions, $page);
    15911595                $action_count = count($actions);