Make WordPress Core

Ticket #58824: 58824.patch

File 58824.patch, 2.7 KB (added by iflairwebtechnologies, 7 months ago)
  • 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 253bcca800..92f35e035f 100644
    a b class WP_List_Table { 
    16581658         * @return string[] Array of CSS classes for the table tag.
    16591659         */
    16601660        protected function get_table_classes() {
    1661                 $mode = get_user_setting( 'posts_list_mode', 'list' );
     1661            global $mode;
     1662
     1663            // Sanitize the mode class name
     1664            $mode_class = esc_attr( 'table-view-' . $mode );
     1665
     1666            // Get the post type
     1667            $post_type = $this->screen->post_type;
    16621668
    1663                 $mode_class = esc_attr( 'table-view-' . $mode );
     1669            // Sanitize the post type class name
     1670            $post_type_class = esc_attr( 'post-type-' . $post_type );
    16641671
    1665                 return array( 'widefat', 'fixed', 'striped', $mode_class, $this->_args['plural'] );
     1672            // Determine if the post type is hierarchical
     1673            $post_type_hierarchical_class = is_post_type_hierarchical( $post_type ) ? 'pages' : 'posts';
     1674
     1675            // Return the array of classes
     1676            return array(
     1677                'widefat',
     1678                'fixed',
     1679                'striped',
     1680                $mode_class,
     1681                $post_type_class,
     1682                $post_type_hierarchical_class,
     1683            );
    16661684        }
    16671685
     1686
    16681687        /**
    16691688         * Generates the table navigation above or below the table
    16701689         *