Make WordPress Core

Changeset 33623


Ignore:
Timestamp:
08/17/2015 03:37:03 PM (11 years ago)
Author:
helen
Message:

List tables: Yet more primary column fallbacks.

Some custom list tables override enough methods for the column definition fallback to never kick in, so let's ensure that toggling columns only applies when a primary column is defined in some way. We also need to show a toggle button when we can when there are no row actions.

props Chouby, obenland, ocean90.
fixes #33313.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r33608 r33623  
    17651765        }
    17661766
    1767         .wp-list-table th:not(.column-primary),
    1768         .wp-list-table th:not(.column-primary),
    1769         .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.column-primary):not(.check-column) {
     1767        .wp-list-table th.column-primary ~ th,
     1768        .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary ~ td:not(.check-column) {
    17701769                display: none;
    17711770        }
    … …  
    17811780        }
    17821781
    1783         .wp-list-table .toggle-row {
     1782        .wp-list-table .column-primary .toggle-row {
    17841783                display: block;
    17851784        }
    … …  
    17961795        }
    17971796
    1798         .wp-list-table tr:not(.inline-edit-row):not(.no-items) td:not(.column-primary):not(.check-column) {
     1797        .wp-list-table tr:not(.inline-edit-row):not(.no-items) td.column-primary ~ td:not(.check-column) {
    17991798                padding: 3px 8px 3px 35%;
    18001799        }
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r33270 r33623  
    12591259         */
    12601260        protected function handle_row_actions( $item, $column_name, $primary ) {
    1261                 return '';
     1261                return $column_name == $primary ? '<button type="button" class="toggle-row"><span class="screen-reader-text">' . __( 'Show more details' ) . '</span></button>' : '';
    12621262        }
    12631263
Note: See TracChangeset for help on using the changeset viewer.