From de02c5d2cda316169aa33423b59e0dfaba1909b9 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Sat, 7 Nov 2015 15:26:05 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@35565 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-list-table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-list-table.php b/src/wp-admin/includes/class-wp-list-table.php index 72f0dc77ff..d1b89c7bad 100644 --- a/src/wp-admin/includes/class-wp-list-table.php +++ b/src/wp-admin/includes/class-wp-list-table.php @@ -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