mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@50516 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1111,8 +1111,13 @@ class WP_List_Table {
|
||||
protected function get_column_info() {
|
||||
// $_column_headers is already set / cached.
|
||||
if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) ) {
|
||||
// Back-compat for list tables that have been manually setting $_column_headers for horse reasons.
|
||||
// In 4.3, we added a fourth argument for primary column.
|
||||
/*
|
||||
* Backward compatibility for `$_column_headers` format prior to WordPress 4.3.
|
||||
*
|
||||
* In WordPress 4.3 the primary column name was added as a forth item in the
|
||||
* column headers property. This ensures the primary column name is included
|
||||
* in plugins setting the property directly in the three item format.
|
||||
*/
|
||||
$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
|
||||
foreach ( $this->_column_headers as $key => $value ) {
|
||||
$column_headers[ $key ] = $value;
|
||||
|
||||
Reference in New Issue
Block a user