WordPress.org

Make WordPress Core

Ticket #13969: display-page-row-cleanup.13969.diff

File display-page-row-cleanup.13969.diff, 5.7 KB (added by filosofo, 4 years ago)
  • wp-admin/includes/template.php

     
    15031503                } 
    15041504        } 
    15051505 
    1506         $page->post_title = esc_html( $page->post_title ); 
    15071506        $pad = str_repeat( '— ', $level ); 
    15081507        $id = (int) $page->ID; 
    15091508        $rowclass = 'alternate' == $rowclass ? '' : 'alternate'; 
     
    15291528 
    15301529        case 'cb': 
    15311530                ?> 
    1532                 <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $page->ID ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th> 
     1531                <th scope="row" class="check-column"><?php if ( current_user_can( $post_type_object->cap->edit_post, $id ) ) { ?><input type="checkbox" name="post[]" value="<?php the_ID(); ?>" /><?php } ?></th> 
    15331532                <?php 
    15341533                break; 
    15351534        case 'date': 
     
    15651564                break; 
    15661565        case 'title': 
    15671566                $attributes = 'class="post-title page-title column-title"' . $style; 
    1568                 $edit_link = get_edit_post_link( $page->ID ); 
     1567                $edit_link = get_edit_post_link( $id ); 
    15691568                ?> 
    1570                 <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name) : ''; ?></strong> 
     1569                <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->cap->edit_post, $id) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent_item_colon . ' ' . esc_html($parent_name) : ''; ?></strong> 
    15711570                <?php 
    15721571                $actions = array(); 
    1573                 if ( current_user_can($post_type_object->cap->edit_post, $page->ID) && $post->post_status != 'trash' ) { 
     1572                if ( current_user_can($post_type_object->cap->edit_post, $id) && $post->post_status != 'trash' ) { 
    15741573                        $actions['edit'] = '<a href="' . $edit_link . '" title="' . esc_attr(__('Edit this page')) . '">' . __('Edit') . '</a>'; 
    15751574                        $actions['inline'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>'; 
    15761575                } 
    1577                 if ( current_user_can($post_type_object->cap->delete_post, $page->ID) ) { 
     1576                if ( current_user_can($post_type_object->cap->delete_post, $id) ) { 
    15781577                        if ( $post->post_status == 'trash' ) 
    1579                                 $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=untrash&amp;post=$page->ID", 'untrash-' . $post->post_type . '_' . $page->ID) . "'>" . __('Restore') . "</a>"; 
     1578                                $actions['untrash'] = "<a title='" . esc_attr(__('Remove this page from the Trash')) . "' href='" . wp_nonce_url("post.php?post_type=$post_type&amp;action=untrash&amp;post=$id", 'untrash-' . $post->post_type . '_' . $id) . "'>" . __('Restore') . "</a>"; 
    15801579                        elseif ( EMPTY_TRASH_DAYS ) 
    1581                                 $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($page->ID) . "'>" . __('Trash') . "</a>"; 
     1580                                $actions['trash'] = "<a class='submitdelete' title='" . esc_attr(__('Move this page to the Trash')) . "' href='" . get_delete_post_link($id) . "'>" . __('Trash') . "</a>"; 
    15821581                        if ( $post->post_status == 'trash' || !EMPTY_TRASH_DAYS ) 
    1583                                 $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>"; 
     1582                                $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=$id", 'delete-' . $post->post_type . '_' . $id) . "'>" . __('Delete Permanently') . "</a>"; 
    15841583                } 
    15851584                if ( in_array($post->post_status, array('pending', 'draft')) ) { 
    1586                         if ( current_user_can($post_type_object->cap->edit_post, $page->ID) ) 
    1587                                 $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($page->ID) ) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 
     1585                        if ( current_user_can($post_type_object->cap->edit_post, $id) ) 
     1586                                $actions['view'] = '<a href="' . esc_url( add_query_arg( 'preview', 'true', get_permalink($id) ) ) . '" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('Preview') . '</a>'; 
    15881587                } elseif ( $post->post_status != 'trash' ) { 
    1589                         $actions['view'] = '<a href="' . get_permalink($page->ID) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 
     1588                        $actions['view'] = '<a href="' . get_permalink($id) . '" title="' . esc_attr(sprintf(__('View &#8220;%s&#8221;'), $title)) . '" rel="permalink">' . __('View') . '</a>'; 
    15901589                } 
    15911590                $actions = apply_filters('page_row_actions', $actions, $page); 
    15921591                $action_count = count($actions); 
     
    16081607                ?> 
    16091608                <td <?php echo $attributes ?>><div class="post-com-count-wrapper"> 
    16101609                <?php 
    1611                 $left = get_pending_comments_num( $page->ID ); 
     1610                $left = get_pending_comments_num( $id ); 
    16121611                $pending_phrase = sprintf( __('%s pending'), number_format( $left ) ); 
    16131612                if ( $left ) 
    16141613                        echo '<strong>';