Ticket #25408: 25408.22.diff
| File 25408.22.diff, 1.3 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/includes/class-wp-list-table.php
832 832 * @return string Name of the default primary column, in this case, an empty string. 833 833 */ 834 834 protected function get_default_primary_column_name() { 835 return ''; 835 $columns = $this->get_columns(); 836 $column = ''; 837 838 // We need a primary defined so responsive views show something, 839 // so let's fall back to the first non-checkbox column. 840 foreach( $columns as $col => $column_name ) { 841 if ( 'cb' === $col ) { 842 continue; 843 } 844 845 $column = $col; 846 break; 847 } 848 849 return $column; 836 850 } 837 851 838 852 /** … … 878 892 if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) { 879 893 // Back-compat for list tables that have been manually setting $_column_headers for horse reasons. 880 894 // In 4.3, we added a fourth argument for primary column. 881 $column_headers = array( array(), array(), array(), '');895 $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); 882 896 foreach ( $this->_column_headers as $key => $value ) { 883 897 $column_headers[ $key ] = $value; 884 898 }