From 51b5ed9fa4c0b3c91529e32c7801212b6a862ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Wed, 10 Jun 2015 14:59:30 +0000 Subject: [PATCH] List tables: Better primary column back-compat. Why are people manually setting `$_column_headers` other than because somebody else told them to? Maybe time will tell. props kovshenin. see #25408. Built from https://develop.svn.wordpress.org/trunk@32722 git-svn-id: http://core.svn.wordpress.org/trunk@32692 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-list-table.php | 12 ++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 2e5c10df1c..641e863475 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -850,8 +850,16 @@ class WP_List_Table { * @return array */ protected function get_column_info() { - if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) && count( $this->_column_headers ) >= 4 ) { - return $this->_column_headers; + // $_column_headers is already set / cached + 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(), '' ); + foreach ( $this->_column_headers as $key => $value ) { + $column_headers[ $key ] = $value; + } + + return $column_headers; } $columns = get_column_headers( $this->screen ); diff --git a/wp-includes/version.php b/wp-includes/version.php index cc445f5ff9..59256cd6e0 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32721'; +$wp_version = '4.3-alpha-32722'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.