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
This commit is contained in:
parent
ca3e473b47
commit
de02c5d2cd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user