From 005d937ce2a2ff8d51169b44fcce7989916706ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Wed, 10 Jun 2015 01:46:27 +0000 Subject: [PATCH] List tables: * Avoid notices in custom list tables that manually set `$_column_headers`. Any plugins using this for a specific purpose should update. * Restore a special class name in the users list table. props georgestephanis, stephdau. see #25408. Built from https://develop.svn.wordpress.org/trunk@32717 git-svn-id: http://core.svn.wordpress.org/trunk@32687 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-list-table.php | 3 ++- wp-admin/includes/class-wp-users-list-table.php | 4 +++- wp-includes/version.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 3acb4d5830..2e5c10df1c 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -850,8 +850,9 @@ class WP_List_Table { * @return array */ protected function get_column_info() { - if ( isset( $this->_column_headers ) ) + if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) && count( $this->_column_headers ) >= 4 ) { return $this->_column_headers; + } $columns = get_column_headers( $this->screen ); $hidden = get_hidden_columns( $this->screen ); diff --git a/wp-admin/includes/class-wp-users-list-table.php b/wp-admin/includes/class-wp-users-list-table.php index fc5ace6da4..d76c310975 100644 --- a/wp-admin/includes/class-wp-users-list-table.php +++ b/wp-admin/includes/class-wp-users-list-table.php @@ -411,6 +411,9 @@ class WP_Users_List_Table extends WP_List_Table { if ( $primary === $column_name ) { $classes .= ' has-row-actions column-primary'; } + if ( 'posts' === $column_name ) { + $classes .= ' num'; // Special case for that column + } $style = ''; if ( in_array( $column_name, $hidden ) ) { @@ -437,7 +440,6 @@ class WP_Users_List_Table extends WP_List_Table { $r .= $role_name; break; case 'posts': - $attributes = 'class="posts column-posts num"' . $style; if ( $numposts > 0 ) { $r .= ""; $r .= ''; diff --git a/wp-includes/version.php b/wp-includes/version.php index ddf375dddf..47c03479a3 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32716'; +$wp_version = '4.3-alpha-32717'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.