From a99f7baa5a385656aa97e5ce0e45e687171430a1 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 18 Nov 2015 23:01:26 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@35698 git-svn-id: http://core.svn.wordpress.org/trunk@35662 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-list-table.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index d1b89c7bad..6467280fb3 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -902,6 +902,10 @@ class WP_List_Table { $columns = $this->get_columns(); $column = ''; + if ( empty( $columns ) ) { + return $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 ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index 6dd29a9431..b5d62bf457 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-beta4-35697'; +$wp_version = '4.4-beta4-35698'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.