List Tables: to ensure that `get_primary_column_name()` can match columns that were added via the `"manage_{$screen->id}_columns"` filer, call `get_column_headers()` instead of `$this->get_columns()`.

List Table classes and `WP_Screen` are already tangled together. The parent list table constructor adds a filter that is called by a function that references the instance globally, even though we have access to it via composition directly in the class that is adding the filter. So the fact that functions here have to be called that reference a screen instance we already have access to is what one might call... less than elegant.

#OOP

Props SergeyBiryukov.
Fixes #34508.

Built from https://develop.svn.wordpress.org/trunk@35565


git-svn-id: http://core.svn.wordpress.org/trunk@35529 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-11-07 15:27:25 +00:00
parent a3d58b3fbe
commit 7a24b60c2a
2 changed files with 2 additions and 2 deletions

View File

@ -937,7 +937,7 @@ class WP_List_Table {
* @return string The name of the primary column.
*/
protected function get_primary_column_name() {
$columns = $this->get_columns();
$columns = get_column_headers( $this->screen );
$default = $this->get_default_primary_column_name();
// If the primary column doesn't exist fall back to the

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-beta3-35564';
$wp_version = '4.4-beta3-35565';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.