diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 76fea0096c..9ec1bcee24 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -832,7 +832,21 @@ class WP_List_Table { * @return string Name of the default primary column, in this case, an empty string. */ protected function get_default_primary_column_name() { - return ''; + $columns = $this->get_columns(); + $column = ''; + + // We need a primary defined so responsive views show something, + // so let's fall back to the first non-checkbox column. + foreach( $columns as $col => $column_name ) { + if ( 'cb' === $col ) { + continue; + } + + $column = $col; + break; + } + + return $column; } /** @@ -878,7 +892,7 @@ class WP_List_Table { if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) { // Back-compat for list tables that have been manually setting $_column_headers for horse reasons. // In 4.3, we added a fourth argument for primary column. - $column_headers = array( array(), array(), array(), '' ); + $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); foreach ( $this->_column_headers as $key => $value ) { $column_headers[ $key ] = $value; }