WordPress.org

Make WordPress Core

Changeset 35698


Ignore:
Timestamp:
11/18/2015 11:00:55 PM (5 years ago)
Author:
wonderboymusic
Message:

List Tables: Fix PHP error notice when $columns is null

Use of register_column_headers() and print_column_headers() creates a _WP_List_Table_Compat without any columns. When the List Table object doesn't have any columns, there's naturally no primary column.

Props danielbachhuber.
Fixes #34148.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r35565 r35698  
    902902        $columns = $this->get_columns();
    903903        $column = '';
     904
     905        if ( empty( $columns ) ) {
     906            return $column;
     907        }
    904908
    905909        // We need a primary defined so responsive views show something,
Note: See TracChangeset for help on using the changeset viewer.