Make WordPress Core

Changeset 50516


Ignore:
Timestamp:
03/09/2021 10:33:47 PM (6 years ago)
Author:
peterwilsoncc
Message:

Docs: Improve compatibility comment in WP_List_Table.

Improve comment explaining backward compatibility check for the primary column in WP_List_Table::get_column_info().

Unprops helen, markjaquith.
See #52628, #34564.

File:
1 edited

Legend:

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

    r50362 r50516  
    11121112                // $_column_headers is already set / cached.
    11131113                if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
    1114                         // Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
    1115                         // In 4.3, we added a fourth argument for primary column.
     1114                        /*
     1115                         * Backward compatibility for `$_column_headers` format prior to WordPress 4.3.
     1116                         *
     1117                         * In WordPress 4.3 the primary column name was added as a forth item in the
     1118                         * column headers property. This ensures the primary column name is included
     1119                         * in plugins setting the property directly in the three item format.
     1120                         */
    11161121                        $column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
    11171122                        foreach ( $this->_column_headers as $key => $value ) {
Note: See TracChangeset for help on using the changeset viewer.