WordPress.org

Make WordPress Core

Changeset 35565


Ignore:
Timestamp:
11/07/2015 03:26:05 PM (5 years ago)
Author:
wonderboymusic
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r35489 r35565  
    938938     */
    939939    protected function get_primary_column_name() {
    940         $columns = $this->get_columns();
     940        $columns = get_column_headers( $this->screen );
    941941        $default = $this->get_default_primary_column_name();
    942942
Note: See TracChangeset for help on using the changeset viewer.