Make WordPress Core

Ticket #32892: 32892.patch

File 32892.patch, 1.9 KB (added by abcd95, 8 months ago)

rought implementation

  • src/wp-admin/includes/class-wp-list-table.php

    diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php
    index cdf31db597..2e7be4fa38 100644
    a b class WP_List_Table { 
    17771777                        $attributes = "class='$classes' $data";
    17781778
    17791779                        if ( 'cb' === $column_name ) {
    1780                                 echo '<th scope="row" class="check-column">';
     1780                                echo '<td class="check-column">';
    17811781                                echo $this->column_cb( $item );
    1782                                 echo '</th>';
     1782                                echo '</td>';
    17831783                        } elseif ( method_exists( $this, '_column_' . $column_name ) ) {
    17841784                                echo call_user_func(
    17851785                                        array( $this, '_column_' . $column_name ),
    class WP_List_Table { 
    17881788                                        $data,
    17891789                                        $primary
    17901790                                );
    1791                         } elseif ( method_exists( $this, 'column_' . $column_name ) ) {
    1792                                 echo "<td $attributes>";
    1793                                 echo call_user_func( array( $this, 'column_' . $column_name ), $item );
    1794                                 echo $this->handle_row_actions( $item, $column_name, $primary );
    1795                                 echo '</td>';
    17961791                        } else {
    1797                                 echo "<td $attributes>";
    1798                                 echo $this->column_default( $item, $column_name );
     1792                                $tag   = ( $primary === $column_name ) ? 'th' : 'td';
     1793                                $scope = ( $primary === $column_name ) ? ' scope="row"' : '';
     1794                               
     1795                                // Attribute for primary column if available in sortable columns.
     1796                                $abbr = '';
     1797                                if ( $primary === $column_name && isset( $sortable[ $column_name ][2] ) && ! empty( $sortable[ $column_name ][2] ) ) {
     1798                                        $abbr = ' abbr="' . esc_attr( $sortable[ $column_name ][2] ) . '"';
     1799                                }
     1800
     1801                                echo "<$tag $attributes $scope $abbr>";
     1802
     1803                                if ( method_exists( $this, 'column_' . $column_name ) ) {
     1804                                        echo call_user_func( array( $this, 'column_' . $column_name ), $item );
     1805                                } else {
     1806                                        echo $this->column_default( $item, $column_name );
     1807                                }
     1808
    17991809                                echo $this->handle_row_actions( $item, $column_name, $primary );
    1800                                 echo '</td>';
     1810                                echo "</$tag>";
    18011811                        }
    18021812                }
    18031813        }